Server Audit Mystery 1: Filtering class_type gets Error Msg 25713

Server Audits allow filtering on certain fields. Two fields claim to be strings, yet don't accept strings for filters. Here's how I figured out filtering on class_type (i.e. object type) 🙂

Stored Procedure / Function / View / Trigger Definitions Can Be Wrong, Even If sp_rename Was Never Used

Some object definitions will be wrong after using sp_rename. But there's another way to have an out-of-sync definition that most are unaware of.

PLEASE, Please, please Stop Using Impersonation, TRUSTWORTHY, and Cross-DB Ownership Chaining

Module Signing was introduced in SQL Server 2005, and yet people are still using Impersonation and TRUSTWORTHY. This needs to stop.

Which Collation is Used to Convert NVARCHAR to VARCHAR in a WHERE Condition? (Part B of 2: “Rabbit”)

Who will win "Who's Collation is it Anyway?" Database Collation is ahead, but Column Collation isn't about to give up.

Which Collation is Used to Convert NVARCHAR to VARCHAR in a WHERE Condition? (Part A of 2: “Duck”)

Microsoft says string literals not prefixed with "N" are converted to the Code Page of the Database OR referenced column. Is that true?

Sessions, Temporary Objects, and the Afterlife

Global temp objects drop automatically when Sessions end, right? But when do they end? Think you know? Are you sure?

Line-Continuation in T-SQL

Some (or maybe most?) languages and operating system command shells allow for breaking up long lines into multiple lines (i.e. lines separated by hitting Enter / Return). This is accomplished by ending a line with a particular character that indicates that the line is not ending. For operating system shells this means that the command… Continue reading Line-Continuation in T-SQL