Jun 23 2009
Return Index Column Metadata for All User Tables
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.
Jun 23 2009
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.
By Timothy • SQL, Syndicated, Tips and Tricks • • Tags: SQL, Tech, Things that won't impress your friends, Tips and Tricks
Jun 24, 2009 @ 10:48:34
Tim, it might be worth mentioning that this only works on SP2 and forward for SQL Server 2005.
Jul 06, 2009 @ 09:34:19
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
Jul 06, 2009 @ 15:38:28
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.