T-SQL to find the SQL Server Installation date | SansSQL

Tuesday, May 20, 2014

T-SQL to find the SQL Server Installation date

Here is an handy T-SQL to find the installation date of SQL Server.

DECLARE @date AS VARCHAR(50), @ServerName AS VARCHAR(100)

SELECT @ServerName = CAST(SERVERPROPERTY('SERVERNAME') AS VARCHAR)

SELECT @date = convert(varchar(50),create_date,107) 
FROM sys.server_principals
WHERE name='NT AUTHORITY\SYSTEM'

PRINT 'This SQL Server Instance "' + @ServerName + '" was insalled on '+ @date 

2 comments:

Rajesh said...

Are you Ready to learn java???

Java Training in Chennai

Anu Sri said...

Nice post. This is very useful. Thanks for sharing.

web designing course chennai

Post a Comment