Ok, no bling in this post, just a down-and-dirty method to use the system catalog views to return all columns and associated metadata for the current database.
Ok, no bling in this post, just a down-and-dirty method to use the system catalog views to return all columns and associated metadata for the current database.
Tags: SQL, Tech, Things that won't impress your friends, Tips and Tricks
This entry was posted on June 23, 2009, 3:54 pm and is filed under SQL, Syndicated, Tips and Tricks. You can follow any responses to this entry through RSS 2.0. You can leave a response, or trackback from your own site.
Arclite theme by digitalnature | powered by WordPress
#1 by Lori on June 24, 2009 - 10:48 am
Quote
Tim, it might be worth mentioning that this only works on SP2 and forward for SQL Server 2005.
#2 by Simon Worth on July 6, 2009 - 9:34 am
Quote
You also need to add a join to the index ID between sys.[indexes] and sys.[index_columns]
Currently it’s just between object ID’s
#3 by Timothy Ford on July 6, 2009 - 3:38 pm
Quote
Simon, thank you for the correction. I’m not quite sure how I overlooked that, as I know better. The script has been corrected and the moose responsible for editing the code (me) has been sacked.