Friday, 10 June 2016

Get the Basic Information of SQL Server

Below is the basic information of the server

 Server or Instance Name

Select @@SERVERNAME as [Server Name\Instance Name]
 

SQL Server Version

Select @@VERSION as SQLServerVersion
SELECT SERVERPROPERTY('productversion') As [product version]
SELECT SERVERPROPERTY ('edition') As [edition]
 
 SQL Server Instance
Select @@ServiceName AS [Service Instance]
   
Current Database
Select DB_NAME() AS [Current Database Name]

  
Other information
SELECT
 SERVERPROPERTY('MachineName') as [Host Name],
 @@SERVERNAME as [Instance Name],
 SERVERPROPERTY('Edition') as [SQL Server Edition], /*shows 32 bit or 64 bit*/
 SERVERPROPERTY('ProductLevel') as ProductLevel, /* RTM or SP1 etc*/
 Case SERVERPROPERTY('IsClustered') when 1 then 'CLUSTERED' else
 'STANDALONE' end as [Server Type],
 @@VERSION as [Version Number]

   

No comments:

Post a Comment

If you have any doubt, please let me know.

Popular Posts