Red Gate forums :: View topic - Overwriting object scripts in a scripts folder.
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Toolkit Previous Versions
SQL Toolkit Previous Versions forum

Overwriting object scripts in a scripts folder.

Search in SQL Toolkit Previous Versions forum
Post new topic   Reply to topic
Jump to:  
Author Message
andy.c



Joined: 02 Aug 2007
Posts: 8

PostPosted: Thu Jan 03, 2008 1:00 am    Post subject: Overwriting object scripts in a scripts folder. Reply with quote

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
Back to top
View user's profile Send private message
andy.c



Joined: 02 Aug 2007
Posts: 8

PostPosted: Thu Jan 03, 2008 11:24 pm    Post subject: Something even stranger... Reply with quote

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.

Thanks,

Andy
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6678

PostPosted: Fri Jan 04, 2008 10:42 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Michelle Taylor



Joined: 30 Oct 2006
Posts: 529
Location: Red Gate Software

PostPosted: Tue Jan 08, 2008 12:38 pm    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group