Coding Standards and Guidelines Introduction: after my interview questions series, readers asked for coding standards, so I kept this set short and practical.
SQL SERVER – Retrieve Information of SQL Server Agent Jobs
sp_help_job returns information about SQL Server Agent jobs in msdb. Run it with no parameters to list every job, plus a few related Agent posts.
SQL SERVER – Change Default Fill Factor For Index
The Default Fill Factor in SQL Server is 0. Change it with sp_configure to leave free space on index pages and reduce page splits. I like mine at 90.
SQL SERVER – NorthWind Database or AdventureWorks Database – Samples Databases
SQL Server 2005 does not install Samples Databases by default. Here is where to get AdventureWorks, and the answer to the next question: where is NorthWind?
SQL SERVER – 2005 Comparison EXCEPT operator vs. NOT IN
The EXCEPT operator returns distinct rows from the left query with no match on the right, just like NOT IN. Both give the same plan, but EXCEPT reads simpler.
What Is NULL in SQL Server? The Value That Isn’t a Value
NULL in SQL Server is not zero and not an empty string. It means the value is unknown, and that changes every comparison you write. Why equals never matches, the NOT IN trap that returns nothing, and where NULL is allowed to live.
SQL SERVER – SQL Code Formatting Tools
SQL Code Formatting matters, and every DBA has a preference; I like uppercase keywords. I ran one script through online formatters and two were worth sharing.






