The FORMAT function turns a date or a number into text with one pattern, and it needs SQL Server 2012 or later. This post shows the patterns for dates and numbers, the culture argument, and the lower case mm that silently returns minutes instead of the month. It also measures FORMAT against CONVERT over 200,000 rows, so you know when to use which.
SQL SERVER – Not Able to Kill SPID with KILL WITH STATUSONLY
Can’t kill SPID with KILL WITH STATUSONLY? It reports a rollback, it does not start one. Why KILLED ROLLBACK lasts, and why to wait.
How to Round Up or Round Down Number in SQL Server? – Interview Question of the Week #125
How do you round up or round down a number in SQL Server? A quick answer using ROUND, CEILING and FLOOR, and how each one behaves.
SQL SERVER – Alternate to AGENT_DATETIME Function
This Alternate to AGENT_DATETIME converts integer date and time values without calling an msdb function. I preserve leading zeros in the time.
Why SELECT HOST_NAME() Returns Empty String? – Interview Question of the Week #119
Question: Why SELECT HOST_NAME() Returns Empty String while connected from certain .net application?
What is the Difference between TRUNCATE and DELETE in SQL Server? – Interview Question of the Week #118
What is the difference between TRUNCATE and DELETE in SQL Server? An interview question that never gets old, with a clear list of the differences.
How to Get Random Records from Table? – Interview Question of the Week #105
How do you get random records from a table? This interview question never gets old. Here is the ORDER BY method I use because its syntax is easy to remember.







