Tom Cooper
3/16/2007 9:15:00 PM
Before doing the update, make sure that what you want to do is add the same
number of hours to every datetime. Unless you never go on daylight savings
time, the number of hours you need to add to local time for a given date
will vary depending on whether or not you are on daylight savings time on
that date.
Tom
"Tony Rogerson" <tonyrogerson@torver.net> wrote in message
news:3438266E-1405-43AC-A871-6DE42096A07C@microsoft.com...
> UPDATE <tablename>
> SET <dbcol> = DATEADD( hour, 5, <dbcol> )
>
> Tony.
>
>
> "Sehboo" <MasoodAdnan@gmail.com> wrote in message
> news:1174053255.336225.59470@e1g2000hsg.googlegroups.com...
>>I have about 100+ tables in my DB, and lot of them have date/time
>> fields. I have to update all these fields. I just need to add 5
>> hours to all the datetime fileds (to make them UTC time, instead of
>> local). I am on SQL Server 2000.
>>
>> Is there any easy solution for this, or will I have to write cursors
>> for each table?
>>
>> thanks
>>
>