Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting the current datetime of SQL Server
Message
From
01/02/2011 17:17:35
 
 
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2008
Application:
Web
Miscellaneous
Thread ID:
01498217
Message ID:
01498221
Views:
43
>Very stupid question, but can you simply use SELECT GETDATE() ?

What I've always done:

"SELECTgetdate() as datetime"

if using time from sqlserver or a query to a time server if that is turned on and configured.

all datetime loggings are set to the sqlserver datetime (or the time server) and just prior to doing so, check a global setting that determines how far out of sync the workstation is allowed to get and if it is > than the maximum allowed, notify the user to contact their system administrator or log it if no user interface
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Reply
Map
View

Click here to load this message in the networking platform