Is there any way to use a Script that checks whether an index already exists in a table?
I have the following script that generates an index in a table:
CREATE NONCLUSTERED INDEX [meu_indice] ON [dbo].[MinhaTabela]
(
[Id] ASC,
[Chave_Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
GO
Would there be any way to check if the index already exists and only create if it does not exist?