A quick way to see which version of SQL Server 2000 or 2005 is running: SERVERPROPERTY returns the product version, the product level and the edition.
SQL SERVER – QUOTED_IDENTIFIER ON/OFF and ANSI_NULL ON/OFF Explanation
What do SET QUOTED_IDENTIFIER and SET ANSI_NULLS do around every stored procedure you create? A plain explanation of both settings, ON and OFF.
SQL SERVER – Delete Duplicate Records – Rows
A short query to delete duplicate records from a table with an identity column: keep the MAX(ID) in each group of duplicate columns and remove the rest.
WINDOW: Reuse an Explicit Running-Total Frame
WINDOW lets me name a window definition and reuse it across compatible calculations. I still specify the partition, ordering and frame. A short name should make the intended calculation easier to review.
TRANSLATE: Map Characters Simultaneously Instead of Cascading Replacements
TRANSLATE maps each input character once, which matters when replacement characters also appear in the search list. Nested REPLACE calls can process earlier replacements again. I compare both results before choosing a cleanup expression.
Showing Comma-Separated Role Members for Every Database Role
Comma-separated role members make direct assignments easier to review. The queries retain empty roles and label public membership as implicit. Keep the underlying rows because nested roles and directory groups need a separate effective-access review.










