Thursday, 11 June 2009

How long as SQL SERVER been up & running …

--How long as SQL Server been up.

select cast((datediff(hh, crdate, getdate()))/24 as varchar(3)) + ' days and ' + cast((datediff(hh, crdate, getdate())) % 24 as varchar(2)) + ' hours ' + cast((datediff(n, crdate, getdate())) % 60 as varchar(2)) + ' minutes' from master..sysdatabases where name = 'tempdb'

No comments:

Post a Comment

Search This Blog

Followers