SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Find unused columns

By Clay Punnett,

This script will find all columns in a table that have only 1 value.  If a column only has 1 value for all rows it probably isn't being used and is causing technical debt.  Consider removing unneeded columns.

Total article views: 920 | Views in the last 30 days: 3
 
Related Articles
FORUM

column size

column size

FORUM

Computed Column

Computed Column

FORUM

split columns

Split columns

FORUM

alter column

alter column

FORUM

add column between two column

add column between two column

Tags
columns    
single    
t-sql    
unused    
value    
 
Contribute