Overwriting object scripts in a scripts folder.

andy.candy.c Posts: 11
edited January 8, 2008 6:38AM in SQL Toolkit Previous Versions

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?




  • I have found some strange behaviour with the SQL Tookit which would like to get some clarification on.

    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.


  • Brian DonahueBrian Donahue Posts: 6,590 New member
    Hi 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.
  • I have added a feature request to the SQL Compare project for SQL Compare to write objects into zero-length files instead of treating them like other pre-existing files that might have something important in and need to be preserved. Does this cover the behaviour you were looking for?
    Software Developer
    Redgate Software
Sign In or Register to comment.