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.
How to Get Column Names From a Table in SQL Server
To get column names from a table in SQL Server, query sys.columns with OBJECT_ID, or read INFORMATION_SCHEMA.COLUMNS. This tutorial tests four methods on a demo table, shows the schema trap that returns too many columns, and builds a paste-ready column list. It also finds every table that has a given column.
What Breaks If I Drop This Column? sys.sql_expression_dependencies
Use sql_expression_dependencies and referencing-entity queries before a column change, then check module text and external callers for gaps.
SQL SERVER – Script: Remove Spaces in Column Name in All Tables
A reader wanted a script to remove spaces from every column name in all tables. Here it is, with a warning first: renaming columns can break your application.
max_length in sys.columns: Bytes, Not Characters
Your generated column came out twice as wide as the original. Here is why max_length counts bytes and how to turn it back into a real declaration.
Metadata-Only Column Changes: Which ALTER COLUMN Is Instant
Six ALTER statements look equally small, but their log cost is not. Here is how to measure each one before the change window.







