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 puddle on the path, with a red scarf, a carrot and coal saved on the step

Table Variables Survive ROLLBACK: Logging Errors in a Transaction

September 28, 2013
Pinal Dave
SQL Tips and Tricks
SQL Error Messages, SQL Server, SQL Transactions, SQL Variable

See how table variables survive rollback to retain error details, then write a permanent error log after a failed SQL Server transaction.

Read More
Two nearly matching tile mosaic panels side by side on a bench, tweezers holding one red tile

Trigram Matching: Finding Similar Words With an N-Gram Table

September 27, 2013
Pinal Dave
SQL Tips and Tricks
SQL Index, SQL Search, SQL Server, SQL String

Build trigram matching with GENERATE_SERIES and an indexed n-gram table, rank shared pieces, and compare spelling similarity with SOUNDEX.

Read More
SQL SERVER - Select Columns from Stored Procedure Resultset

SQL SERVER – Select Columns from Stored Procedure Resultset

September 26, 2013
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Stored Procedure

Need only some columns from a stored procedure resultset? Store it in a temp table with INSERT INTO and EXEC, then select what you need.

Read More
SQL SERVER - How to Access the Previous Row and Next Row value in SELECT statement? - Part 4

SQL SERVER – How to Access the Previous Row and Next Row value in SELECT statement? – Part 4

September 25, 2013
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts, SQL Server, SQL Table Operation

Part 4 on reading the previous row and next row value in a SELECT statement. My friend Szymon Wojcik shows how a numbers table can make the query even faster.

Read More
Window for retrieving previous and next rows in SELECT.

SQL SERVER – How to Access the Previous Row and Next Row value in SELECT statement? – Part 3

September 24, 2013
Pinal Dave
SQL Tips and Tricks
SQL Function

My part 2 solution used ROW_NUMBER, which SQL Server 2000 does not have. Here is how to access the previous row and next row in SQL Server 2000.

Read More
One hand passing a small red-handled peeler to another, while a full knife block stays untouched behind.

Granular Server Roles: ##MS_ServerStateReader## and Friends

September 23, 2013
Pinal Dave
SQL Tips and Tricks
DBA, SQL DMV, SQL Login, SQL Server 2022, SQL Server Security

Assign granular server roles in SQL Server 2022, inspect membership, and give monitoring accounts the state access their queries need.

Read More
Window for retrieving previous and next rows in SELECT.

SQL SERVER – How to Access the Previous Row and Next Row value in SELECT statement? – Part 2

September 23, 2013
Pinal Dave
SQL Tips and Tricks
SQL Function

No CTE in your SQL Server 2005 code? Here is another way to get the previous row and next row value in a SELECT statement, using ROW_NUMBER.

Read More
Previous 1 … 309 310 311 312 313 314 315 … 572 Next
  • Books
  • Testimonials
  • Privacy Policy

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