Functions To Know By Heart

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.

Related Posts

Initial Thoughts On dbachecks

Jess Pomfret has an initial use case for dbachecks: Each check has one unique tag which basically names the check and then a number of other tags that can also be used to call a collection of checks. For this example we are going to use several checks to ensure that we meet the following […]

Read More

Introducing dbachecks

Chrissy LeMaire announces that the dbatools team is onto something big: dbachecks is a framework created by and for SQL Server pros who need to validate their environments. Basically, we all share similar checklists and mostly just the server names and RPO/RTO/etc change. This module allows us to crowdsource our checklists using Pester tests. Such checks include: […]

Read More

1 Comment

  • Kevin3NF on 2017-02-21

    Valid point, but for newish DBAs, GetDate() is the gateway drug to all date functions 😉

Comments are closed

Categories

February 2017
MTWTFSS
« Jan Mar »
 12345
6789101112
13141516171819
20212223242526
2728