Avatar of marrowyung

asked on 

how to apply the same index to all user database except some


I am going to apply the indexes, like:

CREATE NONCLUSTERED INDEX IX_cases_bActive_state_barcode
ON [dbo].[cases] ([bActive],[state])
INCLUDE ([barcode])

Open in new window

so all user database on a SQL instance, any script for it so that I can save a lot of time to apply the index (es) to nearly all user database (except some I don't want)?

the script must have a list let me exclude some user database I don't want to apply for it.

we will have more than 1x indexes I'd like to deploy.

please share a script you usually use on that.

DatabasesSQLMicrosoft SQL ServerScripting Languages

Avatar of undefined
Last Comment

8/22/2022 - Mon