How to inject additional SQL Code into script

Automate and integrate using the SQL comparison API

How to inject additional SQL Code into script

Postby mylesp » Wed Apr 24, 2013 12:06 am

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.

Posts: 2
Joined: Thu Dec 22, 2005 8:39 pm
Location: AMS Auckland New Zealand

Postby Brian Donahue » Thu Apr 25, 2013 9:16 am

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: ... 0809000297
Brian Donahue
Posts: 6590
Joined: Mon Aug 23, 2004 9:48 am

Return to SQL Comparison SDK Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests