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 hand holding a steel punch over a new silver spoon on an anvil, ready to stamp its maker's mark.

Audit Columns From Day One: CreatedAt, UpdatedAt and Who Changed It

October 17, 2012
Pinal Dave
SQL Tips and Tricks
SQL Audit, SQL Constraint and Keys, SQL DateTime, SQL Server, SQL Trigger

Add audit columns with UTC timestamps and trusted change identities, maintain updates in procedures, and know when history is needed.

Read More
A wooden door with three brass bells hanging on cords, each with a small red tassel.

Types of Triggers Quiz: Which Trigger Can Fire on a View?

January 3, 2012
Pinal Dave
SQL Puzzle
SQL Error Messages, SQL Table Operation, SQL Trigger, SQL View

This Types of Triggers Quiz asks which trigger you can put on a view that joins two tables. The answer is INSTEAD OF INSERT. A tested script shows the error an AFTER trigger gives and how the working trigger splits one insert into two tables.

Read More
A wooden abacus on a market stall counter, a hand sliding one red bead across for the day's final sale.

Summary Tables: Keeping Pre-Aggregated Totals Current

June 24, 2011
Pinal Dave
SQL Tips and Tricks
Data Warehousing, SQL Server, SQL Server Agent, SQL Trigger, SQL View

Keep summary tables current with changed-day rebuilds, handle late arrivals and deletes, and reconcile stored totals against detail.

Read More
Hands splicing two ropes together, one strand slipping loose

MERGE Statement Pitfalls

January 10, 2010
Pinal Dave
SQL Tips and Tricks
Output Clause, SQL Server, SQL Transactions, SQL Trigger

MERGE statement pitfalls include duplicate source keys, concurrency races, trigger surprises, and complex actions that deserve testing.

Read More
Beach towels laid edge to edge on the sand, seen from above, one red towel overlapping its neighbor

Preventing Overlapping Date Ranges in a Table

October 31, 2009
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL DateTime, SQL Server, SQL Transactions, SQL Trigger

Detect overlapping date ranges with joins and window queries, use half-open endpoints, and enforce the rule with a multirow trigger.

Read More
SQL SERVER - Fix : Error : 17892 Logon failed for login due to trigger execution. Changed database context to 'master'.

SQL SERVER – Fix : Error : 17892 Logon failed for login due to trigger execution. Changed database context to ‘master’.

June 27, 2009
Pinal Dave
SQL Tips and Tricks
SQL Error Messages, SQL Scripts, SQL Trigger, sqlcmd

Dropped the database your logon trigger writes to? Every login then fails with Error 17892 Logon failed. I recreate the problem and show how to get back in.

Read More
Sql Server Single Record Explorer Tool Window.

SQL SERVER – Interesting Observation of Logon Trigger On All Servers – Solution

June 26, 2009
Pinal Dave
SQL Puzzle
SQL Scripts, SQL Trigger

Why does a logon trigger on all servers fire several times for one login? The answer: several SQL Server services are running and IntelliSense is on.

Read More
Previous 1 2 3 4 5 6 7 8 Next
  • Books
  • Testimonials
  • Privacy Policy

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