Tuesday, May 23, 2023

.:: Check ServerName, SQL Server Version, IP, compatibility_level, log_reuse_wait_desc, recovery_model_desc , Active Transaction :::.


---Open SSMS & Run Command to check version (Capture)
select @@servername as ServerName, @@version as VersionSQL;

-- select IP
SELECT  @@servername as ServerName,
   CONNECTIONPROPERTY('net_transport') AS net_transport,
   CONNECTIONPROPERTY('protocol_type') AS protocol_type,
   CONNECTIONPROPERTY('auth_scheme') AS auth_scheme,
   CONNECTIONPROPERTY('local_net_address') AS local_net_address,
   CONNECTIONPROPERTY('local_tcp_port') AS local_tcp_port,
   CONNECTIONPROPERTY('client_net_address') AS client_net_address

   
---check active transaction
select @@servername as ServerName, @@version as VersionSQL,name,compatibility_level,  
CASE compatibility_level
     WHEN 150 THEN '150<SQL 2019>'
     WHEN 140 THEN '140<SQL 2017>'
     WHEN 130 THEN '130<SQL 2016>'
     WHEN 120 THEN '120<SQL 2014>'
     WHEN 110 THEN '110<SQL 2012>'
     WHEN 100 THEN '100<SQL 2008>'
     WHEN 90 THEN '90<SQL 2005>'
     WHEN 80 THEN '80<SQL 2000>'
   ELSE 'Unknown'
   END 'DBCompatibilityLevel',
log_reuse_wait_desc, recovery_model_desc from sys.databases;


 

No comments:

Post a Comment

Popular Posts