Created
November 1, 2020 12:34
-
-
Save ssougnez/1835739f4ad89cdc2d4d66cdee428e31 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @sql NVARCHAR(MAX); | |
SET @sql = N''; | |
select @sql = | |
(SELECT 'DROP INDEX [' + ix.name + '] ON [' + OBJECT_NAME(ID) + ']; ' | |
FROM sysindexes ix | |
WHERE ix.Name IS NOT null AND OBJECT_SCHEMA_NAME(ID) LIKE 'dbo' | |
for xml path('')); | |
EXEC sp_executesql @sql | |
GO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment