Sunday, February 26, 2012

Get Remote SQL Server Date Time

Hi All,
I have 3 sql servers located at different time zones. Say, CST,PST,EST.
Now how can I get current time at EST,PST from the SQL server located
at CST? Is there any query to do that?
I have a stored proc located in SQL server at CST zone where I need to
query for the current date/time of the other zone sql servers.
I tried below query at CST SQL server
SELECT TOP 1 GETDATE() FROM [SERVER-PST].master.dbo.syslocks
But it always gives CST datetime.
Please reply...
Thanks
RP
Please don't multi-post, this question was answered in another group.
"Ram" <Ram@.discussions.microsoft.com> wrote in message
news:7368A848-06BD-4CD0-935D-B98A656B9A5D@.microsoft.com...
> Hi All,
> I have 3 sql servers located at different time zones. Say, CST,PST,EST.
> Now how can I get current time at EST,PST from the SQL server located
> at CST? Is there any query to do that?
> I have a stored proc located in SQL server at CST zone where I need to
> query for the current date/time of the other zone sql servers.
> I tried below query at CST SQL server
> SELECT TOP 1 GETDATE() FROM [SERVER-PST].master.dbo.syslocks
> But it always gives CST datetime.
> Please reply...
> Thanks
> RP
>

No comments:

Post a Comment