Friday, March 23, 2012

How to test existance for an index

How do I test for the existance of an index with in a specific table?
Thanks,
Bryanselect *
from dbo.sysindexes
where id = object_id(N'dbo.MyTable', 'U') and name = N'MyIndex'
"BDB" wrote:

> How do I test for the existance of an index with in a specific table?
> Thanks,
> Bryan
>
>|||The following stored proc will give list of indexes for given table.
EXECUTE sp_MShelpindex <table_name> , NULL, 1|||Thank you.
"KH" <KH@.discussions.microsoft.com> wrote in message
news:286BE372-C9BB-4CD0-8B52-6A3BBADEC429@.microsoft.com...
> select *
> from dbo.sysindexes
> where id = object_id(N'dbo.MyTable', 'U') and name = N'MyIndex'
>
> "BDB" wrote:
>

No comments:

Post a Comment