Answer: GetDate() and SysDateTime are used to fetch the current datetime of server. But there is a slight difference exists between these two. GetDate() used to get the time upto MilliSeconds where as SysDateTime used to get the time upto NanoSeconds.
If we run the query in Sql Server
SELECT GETDATE() [GetDate], SYSDATETIME() [SysDateTime]
The output will be
GetDate SysDateTime
2012-12-03 11:28:43.500 2012-12-03 11:28:43.5004729
Asked In: NIIT interview |
Alert Moderator