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
A gouache terraced garden links smaller planting modules to a larger supporting terrace through visible fittings.

SQL SERVER – 2005 – Find Tables With Foreign Key Constraint in Database

September 4, 2007
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Scripts, SQL Server, SQL System Table

A foreign key inventory needs both the constraint and its column pairings. I include schema names to identify each table clearly.

Read More
Two small terracotta bowls and one large pale bowl holding blue pebbles, with one vermilion pebble in the large bowl.

GROUPING_ID: Separate Stored NULL Values From ROLLUP Totals

August 26, 2007
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Reports, SQL Scripts, SQL Server

GROUPING_ID helps me distinguish a stored NULL from a subtotal created by ROLLUP. Both can appear in the same column. I keep the grouping bits beside the numbers before adding presentation labels.

Read More
A gouache instrument room shows a fitted mechanism tray lifted from one case beside a prepared matching case.

SQL SERVER – T-SQL Script to Attach and Detach Database

August 24, 2007
Pinal Dave
SQL Tips and Tricks
SQL Backup and Restore, SQL Data Storage, SQL Scripts, SQL Server

Detach Database operations remove a database from its instance without deleting its files. I preserve a recoverable backup before moving them.

Read More
A CSV file.

SQL SERVER – T-SQL Script to Insert Carriage Return and New Line Feed in Code

August 22, 2007
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Server, SQL String

Add a carriage return with CHAR(13) and a New Line Feed with CHAR(10) in T-SQL. Handy for formatting output, dynamic SQL with GO, and saving user text.

Read More
A tangled ball of twine beside the same twine wound neatly onto five spools

Refactoring a Long Stored Procedure Into Readable Steps

August 20, 2007
Pinal Dave
SQL Tips and Tricks
Best Practices, SQL Coding Standards, SQL Server, SQL Stored Procedure

Learn refactoring a long stored procedure with output baselines, named temp tables, dead-code removal, and two-way EXCEPT checks before release.

Read More
Three small plain wooden blocks and a single empty space arranged neatly on an oak tabletop.

The SQL Basics Almost Everybody Skips

August 19, 2007
Pinal Dave
SQL Tips and Tricks
Best Practices, Database, SQL Scripts, SQL Server

Revisit SQL basics that change query results: NULL logic, logical processing order, grouped filters, and the difference between two common counts.

Read More
A stone cairn at a fork in a misty mountain path, its vermilion top stone pointing the way, a distant hiker on that trail.

Writing Clear Error Messages in Procedures

August 16, 2007
Pinal Dave
SQL Tips and Tricks
Best Practices, SQL Error Messages, SQL Server, SQL Stored Procedure

Clear error messages in procedures identify the failed operation, useful keys, and next action without exposing sensitive data.

Read More
Previous 1 … 420 421 422 423 424 425 426 … 438 Next
  • Books
  • Testimonials
  • Privacy Policy

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