Date issue when storing Perfmon data to SQL Server

It is a rather interesting fact that when you setup Perfmon to log all data to a SQL Server instead of to files, the CounterDateTime column is not automatically of the data type DateTime…its varchar…!

In order to do date operations on the table, here is one solution to use for CounterDateTime:

(CAST(SUBSTRING([CounterDateTime],1,23) AS datetime)
Advertisements

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