Wednesday, March 7, 2012

How do i find indexes of the columns in SQL server 2000??

How do i find indexes of the columns of all the tables of the
datbase.........most importantly in SQL server 2000
Thanks a lotselect object_name(si.id), si.name from Sysindexes SI inner join
Sysojbects SO ON
(si.id = so.id) where xtype = 'u'
001fr...@.gmail.com wrote:
> How do i find indexes of the columns of all the tables of the
> datbase.........most importantly in SQL server 2000
> Thanks a lot|||This query will return a list of indexed columns that are NOT primary keys.
SELECT
TableName = cast( TABLE_NAME as varchar(50)),
ColumnName = cast( COLUMN_NAME as varchar(50))
FROM INFORMATION_SCHEMA.COLUMNS c
JOIN dbo.sysindexes i
ON ( c.TABLE_NAME = object_name( i.id )
AND c.COLUMN_NAME = i.name
)
--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
<001frien@.gmail.com> wrote in message news:1163193099.763199.289570@.k70g2000cwa.googlegroups
.com...
>
> How do i find indexes of the columns of all the tables of the
> datbase.........most importantly in SQL server 2000
>
> Thanks a lot
>

No comments:

Post a Comment