This Date Functions Quiz asks what DATEDIFF returns for two dates one day apart, when the unit is year. The answer is 1, because DATEDIFF counts boundaries crossed. A tested script shows an age calculation that works, plus DATETRUNC and EOMONTH.
XML Data Type Quiz: Which Method Returns a Plain Value?
This XML Data Type Quiz asks which xml method returns the customer name as an ordinary SQL value with a type you choose. The answer is value(). A tested script runs the methods on one order document and shows what each one returns.
Ranking Functions Quiz: ROW_NUMBER, RANK or DENSE_RANK?
This Ranking Functions Quiz uses two tied scores to ask what number the next student gets from ROW_NUMBER, RANK and DENSE_RANK. The answer is 3, 3 and 2. A tested script proves it and replaces a cursor loop with one query.
SQL SERVER – Target Recovery Time of a Database – Advance Option in SQL Server 2012
Target Recovery Time is a new database option in SQL Server 2012. Set it above 0 and SQL Server uses indirect checkpoints to limit recovery time.
SQL SERVER – A Quick Trick about SQL Server 2012 CONCAT Function – PRINT
A quick trick with the SQL Server 2012 CONCAT function: three SQL experts suggested within minutes that it works with the PRINT statement too.
SQL SERVER – A Quick Trick about SQL Server CONCAT function
A quick trick from a Virtual Tech Days demo: adding a string to GETDATE() throws an error. CAST fixes it, and SQL Server 2012 CONCAT does it more simply.
SQL SERVER – Effect of SET NOCOUNT on @@ROWCOUNT
Does SET NOCOUNT change @@ROWCOUNT? I ran a quick demo in a session and ten hands went up before I even hit execute. The script and what it shows.





