When instance started up ?

  • Hi,

    I need a programmatic way to find out when the instatnce last started up.

    Thanks

  • I don't know if there's a direct way to do that (might be), but you could log that with a start-up proc.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • SELECT min(login_time) FROM Master..Sysprocesses

    MS SQL has a process that is always running - so the minimum login time for any process is when the service started.

  • Or on SQL 2005, SELECT min(login_time) FROM sys.dm_exec_sessions

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Yup - thanks Gail - better to use the new schema.

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

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