A reader with only MDF files and no backups got a CollationID from DBCC CHECKPRIMARYFILE. Here is how to convert that CollationID to a Collation Name.
How to Build Three Part Name from Object_ID? – Interview Question of the Week #134
If you only have an object_id, can you get the database, schema and object name? Here is a simple script that builds the Three Part Name from Object_ID.
SQL SERVER – How to Abort Index Rebuilding After Specific Time?
An index rebuilding limit can control lock waiting or a resumable execution interval. I decide which behavior the maintenance window needs.
COL_NAME Function in SQL Server: Get a Column Name by ID
The COL_NAME function returns a column’s name when you give it a table’s object ID and the column’s ID. This post uses it to turn the column IDs in index views into names, shows why a column ID is not a position once a column has been dropped, and explains the trap that returns a wrong name when the table lives in another database.
How to Check if a Column Exists in a SQL Server Table
To check if a column exists in a SQL Server table, call COL_LENGTH and test the result for NULL, or look the column up in sys.columns. This post compares the three common checks, including the schema trap in INFORMATION_SCHEMA and the three-part name for another database. It ends with a script that adds a column only when it is missing, and the batch rule that makes that script fail if you ignore it.
SQL SERVER – View Column Dependencies and Output Columns
To Identify Columns used in a view, I distinguish references from returned output columns. Those lists answer different questions.






