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 an old stump with many growth rings beside a young sapling tied with a vermilion ribbon.

Build Your Own SQL Script Library

November 1, 2018
Pinal Dave
SQL Tips and Tricks
Best Practices, DBA, SQL Coding Standards, SQL Scripts

A SQL script library saves you from solving the same problem twice. This post shows a folder layout by task, a header block with the tested version, naming habits, a safe history, tests on a scratch server and a way to retire old scripts, with one small read-only script as an example.

Read More
A hand dropping bolts through a brass ring gauge, one oversized bolt caught on the rim

Linting T-SQL: Rules Worth Automating in a Build

June 4, 2018
Pinal Dave
SQL Tips and Tricks
Best Practices, DevOps, SQL Coding Standards, SQL Server

Use linting T-SQL to flag repeatable code risks, review catalog-based candidates, and automate confirmed rules without false certainty.

Read More
A brass umbrella stand of identical cream umbrellas, one marked only by a small red tassel.

The sp_ Prefix: Finding Stored Procedures Named the Risky Way

January 11, 2018
Pinal Dave
SQL Tips and Tricks
Best Practices, SQL Coding Standards, SQL Server, SQL Stored Procedure

Find user procedures with the sp_ prefix across databases, understand the lookup risk, and move callers through a synonym safely.

Read More
A row of music stands at the same height and angle, a hand straightening the one out of line

A T-SQL Formatting Style Guide for Teams

February 24, 2016
Pinal Dave
SQL Tips and Tricks
Best Practices, SQL Coding Standards, SQL Scripts, SQL Server

Adopt a short T-SQL formatting style with clear columns, joins, aliases, semicolons and comments, and keep review focused on query behavior.

Read More
An old chair with one new leg being glued in, held by a red clamp

Refactoring Old T-SQL One Procedure at a Time

January 1, 2015
Pinal Dave
SQL Tips and Tricks
SQL Coding Standards, SQL Server, SQL Stored Procedure, Testing

Begin refactoring old T-SQL with one procedure, repeatable inputs, duplicate-aware result checks, measured reads, and a simple change log.

Read More
A slipcover that stops short on a lengthened sofa, the new red seat left bare

Stale Views: Why SELECT * Breaks After ALTER TABLE

September 5, 2014
Pinal Dave
SQL Tips and Tricks
Schema, SQL Coding Standards, SQL Server, SQL View

Reproduce stale views after SELECT star and ALTER TABLE, find candidate definitions, refresh with sp_refreshview, and prevent the pattern.

Read More
Gate latch with one toggle seated and the other lifted

AND Before OR: Operator Precedence in WHERE Clauses

July 20, 2014
Pinal Dave
SQL Tips and Tricks
SQL Coding Standards, SQL NULL, SQL Operator

A report showed closed orders even though the filter said open. The reason is how SQL Server groups AND and OR.

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

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