Howto test if and index exist in SQL Server

On September 15, 2009, in SQL, by whaly
IF INDEXPROPERTY(OBJECT_ID('TableName'), 'IndexName', 'IndexID') IS NOT NULL
	PRINT 'Index is here'
ELSE
	PRINT 'Index not found'
Tagged with:  

Leave a Reply