sethreno / schemazen

Script and create SQL Server objects quickly
MIT License
332 stars 140 forks source link

Incorrect syntax for adding index when comparing databases #185

Open amycqx opened 4 years ago

amycqx commented 4 years ago

Hey all, Thanks for creating this handy tool to script and compare databases. I just started using it and ran into a problem while comparing databases.

The v1.4 current version generated scripts in form of:

"ALTER TABLE [table-name] ADD CREATE NONCLUSTERED INDEX [index-name] ON [table-name] (....)"

which is giving syntax error with SQL Server 2014 that I'm using. I believe it should be:

CREATE NONCLUSTERED INDEX [index-name] ON [table-name] (....)"

It might be a little similar to #117 might be able to use a similar fix. Thanks!