This month's discount Comprehensive Database Performance Health Check · Testimonials
SQLAuthority with Pinal Dave
Home
  • Consulting
    • Health Check
  • Free Videos
  • All Articles
    • AI
    • SQL Performance
    • SQL Tips and Tricks
    • Interview Questions and Answers
    • SQL Puzzle
    • SQL Video
    • SQLAuthority News
    • Personal
  • Books
  • Consulting
Padded sleeve board supporting a jacket sleeve beside an unsupported sleeve

Column Aliases: Where You Can Use Them and Where You Cannot

June 8, 2014
Pinal Dave
SQL Tips and Tricks
SQL Coding Standards, SQL Column, SQL Order By

Why does WHERE say the alias does not exist? Here is the order SQL Server follows, two clean fixes and one quiet trap to avoid.

Read More
An open wooden toolbox on a bench with a pair of pliers inside and a small blank paper tag tied on with red string.

SQL Code Comments: Notes Your Future Self Can Read

August 9, 2013
Pinal Dave
SQL Tips and Tricks
SQL Coding Standards, SQL Scripts, SQL Server Management Studio, Starting SQL

SQL Code Comments are the notes SQL Server skips and your teammates read. This post shows the two comment styles, what is worth writing in them, a header block for scripts and procedures, and how to stop a comment from lying after the code changes.

Read More
A cat with a red collar passes through a cat flap while a stray waits outside.

Enforcing Object Naming Rules With a DDL Trigger

June 8, 2013
Pinal Dave
SQL Tips and Tricks
SQL Coding Standards, SQL Server, SQL Trigger

Enforce procedure and index names with a DDL trigger, inspect EVENTDATA, audit rejected attempts, and list existing violations.

Read More
A half-built brick wall with even mortar joints, a taut string line along the top and a trowel on the last brick.

Formatting T-SQL Consistently Across a Team

February 14, 2013
Pinal Dave
SQL Tips and Tricks
Best Practices, Software Development, SQL Coding Standards, SQL Server

Formatting T-SQL consistently means choosing a few readable rules, using a formatter carefully, and keeping historical changes focused.

Read More
Gouache painting of a jumbled heap of pencils beside a neat row with a red pencil sharpener between them

Autocomplete and Code Formatting in SSMS: What Works Today

January 30, 2013
Pinal Dave
SQL Tips and Tricks
Best Practices, SQL Coding Standards, SQL Server Management Studio, SQL Shortcut

Autocomplete and code formatting save time and prevent mistakes when they are set up well. This post covers the IntelliSense features in SSMS, the reasons they stop working, a simple formatting style, and a tested look at what formatting changes in the plan cache.

Read More
A sailboat in a calm harbor flying a long line of signal flags from its mast

Naming Conventions for Tables, Columns and Constraints

March 1, 2012
Pinal Dave
SQL Tips and Tricks
Best Practices, SQL Coding Standards, SQL Constraint and Keys, SQL Server

Use naming conventions for readable SQL Server tables, columns, keys and indexes, then find exceptions and plan safe renames with sp_rename.

Read More
A soap bubble floating above a small red bubble wand on a table by a window.

Common Table Expressions Quiz: Why Did My Second Query Fail?

January 27, 2012
Pinal Dave
SQL Puzzle
CTE, SQL Coding Standards, SQL Error Messages

This Common Table Expressions Quiz defines one CTE, reads it once, and then reads it again. The answer is error 208, because a CTE lives for one statement only. A tested script shows the error, the missing semicolon trap and the recursion limit.

Read More
Previous 1 2 3 4 5 6 Next
  • Books
  • Testimonials
  • Privacy Policy

© 2006 – 2026 All rights reserved. pinal @ SQLAuthority.com