Retrieving the time zone information from Registry

  • Hi,

    Is there any way to retrieve the timezone information from the registry?

    I am able to read it using xp_regread but the problem is i get binary data back,

    is there any way to retrieve the Standard and Daylight Bias for passed in key (slected time zone for eg. "India Standard time" or "Eastern Standard Time"). and also the transition dates.

    Any help is highly appreciated.

  • Here's a snippet from Brian Kelley's article from yesterday, "SQL Server Auditing - Part 1".

    DECLARE @AuditLevel int

    EXEC master..xp_regread 

      @rootkey='HKEY_LOCAL_MACHINE',

      @key='SOFTWARE\Microsoft\MSSQLServer\MSSQLServer',

      @value_name='AuditLevel',

      @value=@AuditLevel OUTPUT

     

    SELECT @AuditLevel

    Brian is talking about retrieving the audit level, but you could use the same code for your purposes.

    Steve

Viewing 2 posts - 1 through 1 (of 1 total)

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