Alternatively you can also use
IF NOT EXISTS(SELECT * FROM sys.indexes
WHERE name='YourIndexName' AND object_id = OBJECT_ID('YourTableName'))
BEGIN
CREATE INDEX...
END
Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
Praveen Dsa | MCITP - Database Administrator 2008 | My Blog | My Page
No comments:
Post a Comment