Skip to content

Instantly share code, notes, and snippets.

@ghotz
Created December 21, 2015 14:51
Show Gist options
  • Save ghotz/123b52cdfd15f4b867ce to your computer and use it in GitHub Desktop.
Save ghotz/123b52cdfd15f4b867ce to your computer and use it in GitHub Desktop.
Generate various maintenance commands
SELECT 'ALTER INDEX [' + I1.name + '] ON [' + SCHEMA_NAME(O1.[schema_id]) + '].[' + O1.name + '] REBUILD;'
FROM sys.indexes AS I1
JOIN sys.objects AS O1
ON I1.[object_id] = O1.[object_id]
WHERE I1.type_desc = 'NONCLUSTERED COLUMNSTORE'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment