How to change the time zone

  • Hi,

    I am using SQL server 2008. Now I need to change the time zone in DB sever as per the country. Con anyone answer me the following queries.

    1. How to change the time zone in DB server.

    2. Do I need to chnge the timing setting in windows also in that server?

    3. I have multiple instances for different zone in that server. Can I set the time for each instance as per the local time of that zone?

    Thanks in advance.

    Ryan
    //All our dreams can come true, if we have the courage to pursue them//

  • Sumanta (9/14/2009)


    Hi,

    I am using SQL server 2008. Now I need to change the time zone in DB sever as per the country. Con anyone answer me the following queries.

    1. How to change the time zone in DB server.

    2. Do I need to chnge the timing setting in windows also in that server?

    3. I have multiple instances for different zone in that server. Can I set the time for each instance as per the local time of that zone?

    Thanks in advance.

    Ok, date functions normally return values based on the regional settings on the server.

    http://blogs.msdn.com/sqlprogrammability/archive/2008/03/18/using-time-zone-data-in-sql-server-2008.aspx

    http://blogs.msdn.com/manisblog/archive/2007/08/28/sql-server-2008-enhancements-in-date-and-time-data-types.aspx

    To answer question 1 and 2. the timezone is server specific, not db related.

    3 No, as far as i know. you can do other things though. you could store your data in UTC format and use the timezone functionality in sql 2008 and change or store your data based on what timezone you want. OR you could use virtual sqlservers for your instances on the one physical host, so that each is its own separate entity and therefore the timezone could be different.

    --------------------------------------------------------------------------------------
    [highlight]Recommended Articles on How to help us help you and[/highlight]
    [highlight]solve commonly asked questions[/highlight]

    Forum Etiquette: How to post data/code on a forum to get the best help by Jeff Moden[/url]
    Managing Transaction Logs by Gail Shaw[/url]
    How to post Performance problems by Gail Shaw[/url]
    Help, my database is corrupt. Now what? by Gail Shaw[/url]

  • Thanks for the reply.

    So can I come to conclusion that if I change the time settings in windows, the same will be reflected in the SQL database. There is no need to change anything in the databse to be in synch with the windows.

    Ryan
    //All our dreams can come true, if we have the courage to pursue them//

  • Sumanta (9/14/2009)


    Thanks for the reply.

    So can I come to conclusion that if I change the time settings in windows, the same will be reflected in the SQL database. There is no need to change anything in the databse to be in synch with the windows.

    As far as I know, SQL Server will look the the server for the date settings, including timezone. only thing to think about, is if you do change anything time related on your server from time to time. Take into account any jobs, backups or log backups, anything which is time/date sensitive.

    --------------------------------------------------------------------------------------
    [highlight]Recommended Articles on How to help us help you and[/highlight]
    [highlight]solve commonly asked questions[/highlight]

    Forum Etiquette: How to post data/code on a forum to get the best help by Jeff Moden[/url]
    Managing Transaction Logs by Gail Shaw[/url]
    How to post Performance problems by Gail Shaw[/url]
    Help, my database is corrupt. Now what? by Gail Shaw[/url]

  • yes....SQL Server will take the time from windows only....

    otherwise u can check it out sumanta,,, change time evry time check through getdate() function in Query window...

    GaNeSH

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

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