Overwriting object scripts in a scripts folder.
andy.c
Posts: 11
Hi,
Is there a way to set the script save behaviour in the Database.SaveToFolder method so that the object scripts can be overwritten instead of a new script file being created with a version number appended to the file name?
Thanks,
Andy
Is there a way to set the script save behaviour in the Database.SaveToFolder method so that the object scripts can be overwritten instead of a new script file being created with a version number appended to the file name?
Thanks,
Andy
Comments
When comparing one scripts folder to anther scripts folder I am getting some inconsistent behaviour.
If I update a source proc and then compare to the destination object and execute the script actions against the destination then the script file is updated as expected.
But if I delete a source proc and do the comparison and execution on the destination scripts folder the destination script file is emptied out (0 bytes) instead of being deleted.
Also if I restore the deleted source proc and then compare and execute on the destination scripts folder, the destination script file is not updated with the restored proc. Instead the file remains a 0 byte file and a new script file is created with the number 1 appended to the file name.
Is this behaviour by design?
This behaviour makes it difficult to build some kind of automated check in with source control (Subversion in this case).
I am using SQL Toolkit 6.
Thanks,
Andy
I think that the script to file engine works this way on purpose, specifically for the reason of source control. If it deletes the script file, it will appear in the source control as MISSING, which may lead people to the conclusion that SQL Compare ate the file. If it's replaced by a zero-length file instead, then you won't waste time trying to figure out why you have a missing file.
Redgate Software