SQL Compare ALTER Scripts to Database
kberridge
Posts: 3
I am trying to setup an environment in which I can edit .sql scripts directly and execute them again the database. To make that doable the scripts need to be ALTERs.
But to do this, I also need to be able to compare the scripts against the database to make sure that nothing has been missed.
Unfortunately, SQL Compare 8.1.0.360 gives an error when comparing against ALTERs. The error is of Medium Severity, Issue is "Non-schema statement was ignored". If I choose to continue and not resolve SQL Compare tells me the script only exists on the database.
I also tried adding an IF EXITS ... DROP at the top of my scripts (I'd rather have alters, but at this point I'll take what I can get). That sort of worked, except I got a Low Severity error, and I really don't want to see 3,000 errors everytime I compare the scripts to the database. I also don't want to have to add IF NOT EXISTS on top of all of my scripts.
Is there a workaround for this or any plans to support it in the future?
Thanks,
Kevin
But to do this, I also need to be able to compare the scripts against the database to make sure that nothing has been missed.
Unfortunately, SQL Compare 8.1.0.360 gives an error when comparing against ALTERs. The error is of Medium Severity, Issue is "Non-schema statement was ignored". If I choose to continue and not resolve SQL Compare tells me the script only exists on the database.
I also tried adding an IF EXITS ... DROP at the top of my scripts (I'd rather have alters, but at this point I'll take what I can get). That sort of worked, except I got a Low Severity error, and I really don't want to see 3,000 errors everytime I compare the scripts to the database. I also don't want to have to add IF NOT EXISTS on top of all of my scripts.
Is there a workaround for this or any plans to support it in the future?
Thanks,
Kevin
Comments
We could definitely do with a way of ignoring errors that are 'expected'. Maybe a 'don't show me this again' option should be provided?
David Atkinson
Product Manager
Red Gate Software
Product Manager
Redgate Software
Two things make ALTERS nice:
1. They're easier to make from the CREATE statement
2. They don't screw up SQL's dependency tracking as badly
That said, I could live with IF EXISTS... DROP
Thanks for the reply!