Friday, 5 July 2019

MS SQL Version, Instance and Compatibility Level, Installed Date


How to get/know the MS SQL Version?
SELECT @@VERSION;

How to get/know the MS SQL Instance?
SELECT @@SERVERNAME;

How to get/know the MS SQL Compatibility Level?
SELECT compatibility_level FROM sys.databases WHERE name = 'YourDatabaseName'; 


How to change the MS SQL Compatibility Level?
ALTER DATABASE YourDatabaseName
SET COMPATIBILITY_LEVEL = 120;

   -- COMPATIBILITY_LEVEL = { 150 | 140 | 130 | 120 | 110 | 100 | 90 } 

How to get/know the MS SQL Installed Date?

SELECT create_date AS InstalledDateTime

FROM sys.server_principals
WHERE sid = 0x010100000000000512000000

How to get/know the latest upgrade date of MS SQL Server? 
  • Go to Control Panel\All Control Panel Items\Programs and Features, locate "Microsoft SQL Server" , the 'installed on' field will show you the date when it was been installed


No comments:

Post a Comment