Kevin Hill has a top ten functions list for database administrators:
3. DBCC Opentran – log file filling up? Processes blocked and timing out? See if some doofus (hopefully not you) left a transaction open and went to lunch. If you are lucky you can kill it. Unlucky and you find an undistributed replicated transaction.
4. Getdate() – Not sure why, but this winds up in probably 80% of the scripts I write. Not surprisingly, it often brings along it’s little brother, DateDiff.
I’d go with GETUTCDATE() or SYSUTCDATETIME() over GETDATE(); that way, everything gets stored as UTC and you spend less time worrying about time zone or Daylight Savings Time issues.
1 Comment