get index name within specific table name
Posted
by AmRoSH
on Stack Overflow
See other posts from Stack Overflow
or by AmRoSH
Published on 2010-04-26T20:59:03Z
Indexed on
2010/04/26
21:03 UTC
Read the original article
Hit count: 150
indexing
|sql-server
I need to check if this index not exist in specific table name not in all tables because this select statement select all indexes under this condition.
IF NOT EXISTS (SELECT name from sysindexes WHERE name = 'IDX_InsuranceID')
CREATE NONCLUSTERED INDEX [IDX_InsuranceID] ON [dbo].[QuoteInsurances]
(
[InsuranceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 80) ON [PRIMARY]
GO
Thanks,
© Stack Overflow or respective owner