Red Gate forums :: View topic - How to inject additional SQL Code into script
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Comparison SDK 10
SQL Comparison SDK 10 forum

How to inject additional SQL Code into script

Search in SQL Comparison SDK 10 forum
Post new topic   Reply to topic
Jump to:  
Author Message
mylesp



Joined: 22 Dec 2005
Posts: 2
Location: AMS Auckland New Zealand

PostPosted: Wed Apr 24, 2013 1:06 am    Post subject: How to inject additional SQL Code into script Reply with quote

As part of the differences/upgrade script produced, at the end and within the same transaction we want to be able to call stored procedures and update data tables (e.g. update the internal records that contain our database schema version).

Of course we want this to happen as part of the same transaction.

Is this possible?

We currently use the SQL Compare tool and then modify the script to perform these actions, but of course this cannot be done if we automate this process.

Or is there some way to wrap the current code up so that it uses an external transaction, and we can then perform the actions using normal ADO.NET functionality.

Thanks,
Myles.
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6589

PostPosted: Thu Apr 25, 2013 10:16 am    Post subject: Reply with quote

Hello Myles, SDK doesn't specifically support slipstreaming SQL into the code written by the ExecutionBlock. What I do is pull apart the individual blocks and write them out in a loop -- then I can put my own custom SQL wherever I need to. Please see code sample here:

http://www.red-gate.com/supportcenter/content/knowledgebase/SQL_Comparison_SDK/KB200809000297
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