New Column in sys.dm._os_sys_info

There is a new column in the sys.dm_os_sys_info dynamic management view in SQL Server 2008, called sqlserver_start_time, which shows the last time SQL Server was started. I have a couple of sample queries below that show some of the other useful information you can get from this DMV.

Knowing the number of CPUs, (logical and physical) can be very useful, so it is nice to be able to get that information from a DMV.

 

-- Get some hardware information from SQL Server 2008
SELECT cpu_count AS 'Logical CPU Count', hyperthread_ratio AS 'Hyperthread Ratio',
cpu_count/hyperthread_ratio As 'Physical CPU Count', 
physical_memory_in_bytes/1048576 AS 'Physical Memory (MB)'
, sqlserver_start_time
FROM sys.dm_os_sys_info


-- Get some hardware information from SQL Server 2005
SELECT cpu_count AS 'Logical CPU Count', hyperthread_ratio AS 'Hyperthread Ratio',
cpu_count/hyperthread_ratio As 'Physical CPU Count', 
physical_memory_in_bytes/1048576 AS 'Physical Memory (MB)'
FROM sys.dm_os_sys_info
 
Technorati Tags:

This entry was posted in SQL Server 2008. 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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s