DEV Community

Cover image for SQL-Quick tip #14 - Server information
Allan Simonsen
Allan Simonsen

Posted on

SQL-Quick tip #14 - Server information

Sql Server tips and tricks

This is part of a series of quick tips and tricks I have accumulated over the year, that I think can be useful for others.
If you have similar short tips and tricks please leave a comment.

Server information

Some times you need information about the operating system and don't have direct access to the operating system, then you can use the scripts below to get some basic information about the operating system and the Sql Server version and when the server was booted.

SELECT host_distribution AS [Operating system],
       @@VERSION AS [Sql Server version],
       physical_memory_kb AS [Physical memory in Kb],
       sqlserver_start_time AS [Last boot time],
       cpu_count AS [CPU count]
  FROM sys.dm_os_host_info, sys.dm_os_sys_info
Enter fullscreen mode Exit fullscreen mode

Sql Server Management Studio screenshot

Top comments (0)