Prevent SQL injection by separating values from command text, parameterizing dynamic SQL, and validating object names before using QUOTENAME.
SQL SERVER – Improve Performance by Reducing IO – Creating Covered Index
My T-SQL Tuesday #004 post on how a covered index can improve performance by reducing IO. Run the demo on a test server only, never on production.
ATN2: Keep the Quadrant When Calculating an Angle
ATN2 uses two components to calculate an angle while retaining its quadrant. I keep the argument order and angle unit visible. Dividing one component by the other would lose useful information and introduce a zero-denominator case.
Replacing Old Syntax in Legacy T-SQL
Modernize legacy T-SQL by replacing old joins, TEXT columns, and fragile RAISERROR forms with clear, tested alternatives.
Modeling Data Before Writing Tables
Modeling data before tables clarifies entities, relationships, keys, and grain so schema changes do not discover the rules too late.
SQL SERVER – Order of Columns in Update Statement Does not Matter
Does the order of columns in UPDATE statements matter? No. Setting Col1 before Col2 or the other way round gives the same result in SQL Server.
SQL SERVER – Rollback TRUNCATE Command in Transaction
Many believe TRUNCATE cannot be rolled back. It can. Here is a Rollback TRUNCATE command example inside a transaction, and why TRUNCATE is logged.







