If yo want to get all drop index script from database you can use this.
like '%idx_%' = index prefix
--Drop All Index
declare @qry nvarchar(max);
select @qry =
(SELECT 'DROP INDEX ' + ix.name + ' ON ' + OBJECT_NAME(ID) + '; '
FROM sysindexes ix
WHERE ix.Name IS NOT null and ix.Name like '%idx_%'
for xml path(''));
SELECT @qry
This will return all drop index script on result. now copy the script for your use.
Comments
Post a Comment