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
Gouache painting of a small red-tabbed group of cards separated from a larger file drawer by a brass guide.

Replace SELECT * with Column Names in SQL Server: SQL in Sixty Seconds #017

June 6, 2012
Pinal Dave
SQL Video
SQL Coding Standards, SQL Column, SQL in Sixty Seconds, SQL Server Management Studio, SQL View

Replace SELECT * with the columns your application needs. The tests here show a query that read 4 pages instead of 64, a view that missed a new column, and two errors that appear when a table changes, all on SQL Server 2025.

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
A garden entrance with a red bar closed across it between two stone posts, a path continuing beyond.

Policy Based Management Quiz: Which Mode Can Stop a Change?

January 26, 2012
Pinal Dave
SQL Puzzle
Best Practices, Policy Management, SQL Coding Standards, SQL Server Configuration

This Policy Based Management Quiz asks which evaluation mode can stop a bad change before it is saved. The answer is On change: prevent. A tested T-SQL script blocks a badly named table and shows how few facets support that mode.

Read More
A hand checking an unlit firework rocket standing in a bottle on a garden wall, the matches still closed.

SET NOEXEC and PARSEONLY: Checking a Script Without Running It

January 4, 2012
Pinal Dave
SQL Tips and Tricks
SQL Coding Standards, SQL Dependency, SQL Server, SQL Stored Procedure

Use PARSEONLY and NOEXEC to inspect scripts without executing them, understand deferred references, and check existing module dependencies.

Read More
Two boxes joined by an arrow. Phase one, organize, runs SELECT star in three steps that return 4, 7 and 5 rows. Phase two, itemize, swaps the star for a column list and returns the same 5 rows

Build a Query in Two Phases: Organize First, Itemize Second

August 4, 2011
Pinal Dave
SQL Tips and Tricks
Best Practices, SQL Coding Standards, SQL Joins, SQL Scripts

Build a query in two phases: organize first, itemize second. Phase one gets the tables, joins and filter working with SELECT *, and phase two swaps the star for a column list. This post shows the method on a small branch and staff table, and the three errors it helps you avoid.

Read More
A jigsaw puzzle with pieces sorted into groups before being fitted together

Common Table Expressions for Readability

April 20, 2011
Pinal Dave
SQL Tips and Tricks
CTE, SQL Coding Standards, SQL Server, Temp Table

Common table expressions for readability name query steps and support recursion, but they do not promise cached intermediate results.

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

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