[dba-SQLServer] All tables, columns and indexes

Arthur Fuller fuller.artful at gmail.com
Mon Aug 4 17:26:22 CDT 2008


Very nice. Now I just have to dig my notes on Coalesce so I can
comma-delimit the indexed columns for each index rather than get multiple
rows, but not should not be difficult.

Thanks!

On Mon, Aug 4, 2008 at 4:20 PM, kens.programming <
kens.programming at verizon.net> wrote:

> Arthur,
>
> Is something like this what you are looking for?:
>
> SELECT so.name, si.name, sc.name
> FROM sysobjects so INNER JOIN sysindexes si ON so.id = si.id
>        INNER JOIN sysindexkeys sik ON si.indid = sik.indid AND so.id =
> sik.id
>        INNER JOIN syscolumns sc ON sik.colid = sc.colid AND so.id = sc.id
> WHERE so.type = 'U'
>
> Ken
>



More information about the dba-SQLServer mailing list