Hi Sloan,
This should give you (most of) the information you are looking for:
SELECT
OBJECT_NAME(sik.id) AS Table_Name,
si.name AS Index_Name,
col.name AS column_name,
sik.keyno,
CASE INDEXKEY_PROPERTY(sik.id , sik.indid, sik.keyno , 'IsDescending')
WHEN 1 THEN 'DESC'
WHEN 0 THEN 'ASC'
END AS sort_order
FROM sysindexkeys sik
INNER JOIN sysindexes si
ON sik.id = si.id
AND sik.indid = si.indid
INNER JOIN syscolumns col
ON sik.id = col.id
AND sik.colid = col.colid
WHERE sik.indid BETWEEN 1 AND 254
AND OBJECTPROPERTY(sik.id, 'IsMSShipped') = 0
AND INDEXPROPERTY(sik.id, si.name, 'IsStatistics') = 0
ORDER BY table_name, index_name, keyno
--
Jacco Schalkwijk
SQL Server MVP
[quoted text, click to view] "Sloan Thrasher" <cst2000@comcast.net> wrote in message
news:y%IUb.234303$xy6.1216803@attbi_s02...
> Hi Jacco!
>
> Thanks! I should have been a bit more specific -- sorry.
>
> I'm actually looking for the details i.e. which columns are involved,
> asending/desending, etc.
>
> Thanks!
>
> Sloan
>
> "Jacco Schalkwijk" <NOSPAMjaccos@eurostop.co.uk> wrote in message
> news:O6ZhJn$6DHA.2996@tk2msftngp13.phx.gbl...
> > SELECT OBJECT_NAME(id) AS table_name, name as index_name
> > FROM sysindexes
> > WHERE indid BETWEEN 1 AND 254
> > AND OBJECTPROPERTY(id, 'IsMSShipped') = 0
> > AND INDEXPROPERTY(id, name, 'IsStatistics') = 0
> >
> > --
> > Jacco Schalkwijk
> > SQL Server MVP
> >
> >
> > "Sloan Thrasher" <cst2000@comcast.net> wrote in message
> > news:NEgUb.177086$5V2.879192@attbi_s53...
> > > Hi all!
> > >
> > > Is there a way to get a list of indexes via a SQL statement? I'm
working
> > on
> > > a DB documentor, and am able to retrieve almost everything else about
> the
> > > definitions, but I haven't been able to get a list of indexes.
> > >
> > > Thanks!
> > >
> > > Sloan
> > >
> > >
> >
> >
>
>