This Create Constraints Quiz adds a CHECK constraint WITH NOCHECK to a table that already holds a bad row. The bad row stays, and the constraint is marked not trusted. A tested script proves it, shows what trust changes for the optimizer and lists four ways to create a constraint.
CHAR, VARCHAR, NVARCHAR and VARCHAR(MAX) Quiz: How Many Bytes?
This CHAR, VARCHAR, NVARCHAR and VARCHAR(MAX) Quiz stores the text abc in three columns and asks how many bytes each one uses. The answer is 10, 3 and 6. A tested script proves it and shows the trailing space trap, the question mark problem and the 8,000 byte limit.
Checking Data Fits Before Narrowing a Column Data Type
Check existing values before narrowing a column, account for dependencies and data loss, and plan the locking cost of the change.
Finding Every Object That Uses a Column
Find an object that uses a column with dependency metadata and module text search, then check dynamic SQL and application code.
Finding Column Definitions Without the Documentation
Find column definitions in SQL Server with sys.columns, sys.types, and sys.all_columns, including length, nullability, and system objects.







