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 database character beside a stopwatch

T-SQL Errors and Reactions Demo: SQL in Sixty Seconds #005

March 7, 2012
Pinal Dave
SQL Video
SQL Error Messages, SQL in Sixty Seconds, SQL Scripts

This T-SQL errors and reactions demo follows episode #002 with queries you can run. It shows what a CATCH block can read, how severity is stored, how to log a failure and keep going, and why THROW keeps the original error while RAISERROR replaces it.

Read More
A flax comb with finished fibers held aside by a small retaining band

Stopping a Trigger From Firing Itself With TRIGGER_NESTLEVEL

March 2, 2012
Pinal Dave
SQL Tips and Tricks
Database, SQL Scripts, SQL Server

A timestamp trigger that updates its own table can loop until SQL Server gives up. Here is the small guard that stops it, with a demo you can run.

Read More
Gouache painting of a database character beside a stopwatch

Leap Year in SQL Server: SQL in Sixty Seconds #004

February 29, 2012
Pinal Dave
SQL Video
SQL DateTime, SQL Function, SQL in Sixty Seconds, SQL Scripts

To find a leap year in SQL Server, ask EOMONTH for the last day of February. I tested the method against the divisibility rule for every year from 1 to 9999 and found no disagreement. The post also shows an inline function, the errors for invalid years and a one-line TRY_CONVERT test.

Read More
Gouache painting of a frog leaping across four lily pads on a pond, the last pad holding a red flower

Detect a Leap Year in T-SQL: Four Simple Ways

February 28, 2012
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts

Detecting a Leap Year in T-SQL takes one rule or one date trick. This post tests four ways on SQL Server 2025: the calendar rule, EOMONTH, TRY_CONVERT and DATEDIFF. It shows that all four agree on 209 years, explains the century years that trip people up, and answers how leap years affect date math.

Read More
SQL SERVER - Identifying Guest User using Policy Based Management

SQL SERVER – Identifying Guest User using Policy Based Management

February 27, 2012
Pinal Dave
SQL Tips and Tricks
Best Practices, Policy Management, SQL Scripts, SQL Server

Can a policy catch a guest user left enabled in user databases? Here is a quick tutorial on identifying guest user access with Policy Based Management.

Read More
Gouache painting of a stone moving from an open envelope into a fitted compartment in a wooden sorting tray.

Declare and Initialize Variables in SQL Server: SQL in Sixty Seconds #003

February 22, 2012
Pinal Dave
SQL Video
SQL Datatype, SQL in Sixty Seconds, SQL Scripts, SQL Variable

To declare and initialize variables in one statement, give each variable a type and a starting value in the same DECLARE. The tests here show the NULL default, a loop that does not reset an uninitialized variable, and the one character varchar trap on SQL Server 2025.

Read More
Office desk at night with the lamp still on, a mug and a jacket on the chair, someone is still logged in

SQL SERVER – Force Removing User from Database – Fix: Error: Could not drop login ‘test’

February 21, 2012
Pinal Dave
SQL Tips and Tricks
SQL Error Messages, SQL Scripts, SQL Server, SQL Server Security

Error 15434: could not drop login ‘test’ because the user is logged in. A reader ran my demo on production; here is my Force Removing User fix, no restart needed.

Read More
Previous 1 … 207 208 209 210 211 212 213 … 363 Next
  • Books
  • Testimonials
  • Privacy Policy

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