Is Your Server Virtual or Physical?

Ever wondered whether an instance of SQL is hosted on a virtual or physical server? This query will tell you:

SELECT
CASE virtual_machine_type
WHEN 1 THEN 'VIRTUAL'
ELSE 'PHYSICAL'
END as [ServerType]
from sys.dm_os_sys_info

You can also determine whether your server is clustered or not via T-SQL:


SELECT
CASE SERVERPROPERTY ('IsClustered')
WHEN 1 THEN 'YES' WHEN 0
THEN 'NO'
END as [CLUSTERED]

These are just a few of the queries I run when I am handed over a server that I have not been responsible for. You can see more of these queries in this post.

Author: Richie Lee

Full time computer guy, part time runner. Full time Dad, part time blogger. Knows a thing or two about Pokémon. Knows too much about SQL Agent. Writer of fractured sentences. Maker of the best damn macaroni cheese you've ever tasted.

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