1. 程式人生 > >SQL Server 2008R2各個版本,如何檢視是否啟用,剩餘可用日期?

SQL Server 2008R2各個版本,如何檢視是否啟用,剩餘可用日期?

SELECT  create_date AS 'SQL Server Installed Date',
    	Expiry_date AS 'SQL Server Expiry Date',
   	DATEDIFF(dd,create_date, GETDATE()) 'No_of_Days_Used',
   	ABS(DATEDIFF(dd,expiry_date,GETDATE())) 'No_Of_Days_Left'
FROM
(SELECT sp.create_date,
    	DATEADD(dd, 180, sp.create_date) AS Expiry_date
 FROM   sys.server_principals sp
 WHERE  sp.name = 'NT AUTHORITY\SYSTEM') as exp_date_tbs