OLAPQueryLog StartTime is Wrong

I recently saw a post on the newgroup about the StartTime in the OLAPQueryLog being incorrect. We have the same problem here (StartTime is eight hours ahead) and it’s something I accepted but never looked into the cause.
 
It appears the insert is using GetUTCDate, not GetDate. GetDate uses the OS time zone. I haven’t found a way to change this behavior.
 
You could add another column to store the value, however I just wrote a view on top of the table. From what I can tell this should (at least is does right now) handle daylight savings time correctly; hardcoding the hour difference may not.
 
 

SELECT

       MSOLAP_Database,

       MSOLAP_ObjectPath,

       MSOLAP_User,

       Dataset,

       (DATEADD(HOUR,(DATEDIFF(HOUR, GetUTCDate(), GetDate() )),StartTime)) as StartTime,

       Duration

FROM

       OlapQueryLog

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s