A Temporary table uses CREATE TABLE, while a table variable uses DECLARE. I use one row in each beginner example.
Adding Two Dates in SQL Server: Why the Year Is 2126
Adding two dates in SQL Server does not raise an error. It returns a date in the year 2126. This puzzle explains how datetime counts days from 1900, why the plus sign accepts a second date, and what to write instead.
Run a Stored Procedure at Startup in SQL Server
To run a stored procedure at startup, create it in the master database and mark it with sp_procoption. This post builds a demo that writes one row every time the instance starts. It also covers the rules, how to check the setting, and how to turn it off again.
Can You DROP Offline Database? – Interview Question of the Week #144
Can you drop offline database in SQL Server? Yes, you can. Many DBAs I interviewed thought otherwise, so here is the full answer.
SQL SERVER – RETAINDAYS Does Not Delete Backup After x Days
RETAINDAYS sets backup expiration for overwrite checks, without deleting the file. I keep SQL expiration separate from Windows file cleanup.







