To SELECT a single row for a quick look at a table, set up an SSMS query shortcut that runs SELECT TOP 1. The tests here show which row comes back, how an index or a heap changes it, what it costs on a 200,000 row table and when to add ORDER BY.
SQL SERVER – Avoid Using Function in WHERE Clause – Scan to Seek
Does a function in WHERE clause really hurt performance? Using AdventureWorks and STATISTICS IO, I show what happens and how to turn a scan into a seek.
How to Add Column at Specific Position in SQL Server
To add column at specific position in SQL Server, you have three tested options, because ALTER TABLE always adds the column last. This post shows a SELECT list, a view for loads and reports, and a full table rebuild. It also explains what the rebuild costs.
BACPAC or Backup: When an Export Is the Wrong Tool
A BACPAC export has rows in it, but it is not a recovery backup. Here is a small demo that shows the difference.
SQL SERVER – Tricky Question – What is the Default Size of the Database
What is the default size of the database in SQL Server? Many guess 3 MB or 4 MB, but the real answer depends on the model system database.
SQL SERVER – Check If String is a Palindrome in Using T-SQL Script – Reverse Function
A friend building a captcha had to skip words that read the same backward. Here is a T-SQL script with REVERSE to check if a string is a Palindrome.
SQL SERVER – Exporting Query Results to CSV using SQLCMD
A reader on Facebook asked how to export query results to CSV using SQLCMD. It is a very simple command, and I show it with an AdventureWorks2012 example.
SQL SERVER – SSMS Does NOT Print NULL Values
Here is a very interesting question asked on the blog by Karthik. I really liked the question and I would like to discuss this here about SSMS doe snot Print NULL values.










