Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Get SQLServer Name and Uptime SPROC Expand / Collapse
Author
Message
Posted Tuesday, November 16, 2010 12:30 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, February 27, 2014 2:20 PM
Points: 1, Visits: 43
Comments posted to this topic are about the item Get SQLServer Name and Uptime SPROC
Post #1021259
Posted Tuesday, November 16, 2010 5:11 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Wednesday, April 16, 2014 7:47 AM
Points: 1,174, Visits: 2,635
Alternatively:

SELECT TOP 1 login_time FROM master..sysprocesses (NOLOCK)
ORDER BY login_time

Since I've noticed that on some of our SQL servers spid 1 is not the longest running process!

How, I don't know! Maybe someone more knowledgeable can explain


--
Nigel
Useful Links:
How to post data/code on a forum to get the best help
The "Numbers" or "Tally" Table - Jeff Moden

Post #1021385
Posted Tuesday, November 16, 2010 7:30 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, February 27, 2014 2:20 PM
Points: 1, Visits: 43
Thanks for the update, Nigel. I will update the SPROC code.

Chris
Post #1021509
Posted Tuesday, November 16, 2010 3:08 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: 2 days ago @ 9:44 AM
Points: 86, Visits: 675
There are many ways to skin a cat:

This is my way:

select crdate,[Name] from sys.sysdatabases where name = 'tempdb'

Why does this work?
Well... every time you MSSQL Starts, it recreates the TEMPDB.
:)

Miguel
Post #1021822
Posted Wednesday, November 17, 2010 2:03 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Wednesday, April 16, 2014 7:47 AM
Points: 1,174, Visits: 2,635
MiguelSQL (11/16/2010)
There are many ways to skin a cat:


Indeed there are


This is my way:

select crdate,[Name] from sys.sysdatabases where name = 'tempdb'

Why does this work?
Well... every time you MSSQL Starts, it recreates the TEMPDB.
:)

Miguel


And it looks like like the tempdb is created even sooner than the first process (at least it is on the couple of instances I tried). YMMV



--
Nigel
Useful Links:
How to post data/code on a forum to get the best help
The "Numbers" or "Tally" Table - Jeff Moden

Post #1021960
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse