Howto test if and index exist in SQL Server

1 minute read Published:

IF INDEXPROPERTY(OBJECT_ID('TableName'), 'IndexName', 'IndexID') IS NOT NULL
	PRINT 'Index is here'
ELSE
	PRINT 'Index not found'
comments powered by Disqus