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
Click to include actual execution plan.

SQL SERVER – Actual Execution Plan vs. Estimated Execution Plan

August 28, 2007
Pinal Dave
SQL Performance
DBA, Execution Plan, SQL Scripts

Actual Execution Plan or Estimated Execution Plan? I always use the actual plan because it is accurate. Shortcuts: CTRL+M for actual, CTRL+L for estimated.

Read More
SQL SERVER - 2005 - Use Always Outer Join Clause instead of (*= and =*)

SQL SERVER – 2005 – Use Always Outer Join Clause instead of (*= and =*)

August 27, 2007
Pinal Dave
SQL Tips and Tricks
SQL Deprecated Feature, SQL Joins, SQL Scripts

My friend’s queries failed in SQL Server 2005 because they used *= and =* for joins. Always use the LEFT or RIGHT outer join clause instead.

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
SQL SERVER - FIX : Error : msg 2540 - The system cannot self repair this error

SQL SERVER – FIX : Error : msg 2540 – The system cannot self repair this error

August 25, 2007
Pinal Dave
SQL Tips and Tricks
SQL Backup and Restore, SQL Data Storage, SQL Error Messages, SQL Scripts

Msg 2540 means the system cannot self repair this error, usually corrupt metadata or system files. My fix order: restore the backup, DBCC repair, check hardware.

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
SQL SERVER - 2005 - Use of Non-deterministic Function in UDF - Find Day Difference Between Any Date and Today

SQL SERVER – 2005 – Use of Non-deterministic Function in UDF – Find Day Difference Between Any Date and Today

August 23, 2007
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Error Messages, SQL Function, SQL Scripts

I always thought a non-deterministic function was not allowed in a UDF, but GETDATE() works in SQL Server 2005. My UDF finds the day difference from today.

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
Previous 1 … 798 799 800 801 802 803 804 … 842 Next
  • Books
  • Testimonials
  • Privacy Policy

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