Get SQLServer Name and Uptime SPROC

  • Comments posted to this topic are about the item Get SQLServer Name and Uptime SPROC

  • 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

  • Thanks for the update, Nigel. I will update the SPROC code.

    Chris

  • 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

  • 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

  • Thanks for the script Chris.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply