XACT_STATE separates transaction validity from the decision to retain work. Two isolated examples show a doomed transaction and a committable one, both with deliberate errors. Clean up on the same connection and respect the caller’s transaction ownership.
Documenting a Database With Extended Properties
Keep extended properties beside your SQL Server schema, maintain table and column descriptions, and query a useful data dictionary.
Standard Settings for a New SQL Server Install
Review standard settings for a new SQL Server install, including memory, MAXDOP, tempdb, backups, and alerts before users depend on it.
Checking Every Database for Risky Settings
Find risky settings across every SQL Server database, including AUTO_SHRINK, AUTO_CLOSE, page verification, recovery model, and ownership.
Writing Tests for Stored Procedures
Write tests for stored procedures with arrange, act, and assert steps in T-SQL, isolated data, and a repeatable check before every change.
Check Constraints That Enforce Business Rules
Check constraints keep row rules inside SQL Server, but NULL behavior and trusted status determine how much protection they provide.
Finding the Right System View for the Question You Have
Choose SQL Server system views by the question they answer, distinguish catalog metadata from runtime counters, and understand reset boundaries.







