mssql: insterting data into identity column


In order to insert data into the identity column of mssql db, I have figured out that I can add:

<modifySql dbms="mssql">


into changeset, or add specific statements before/after insert.

Is there a way to set IDENTITY_INSERT before every insert so I do not have to edit hundreds of changesets?


There will be for 2.0, you an create your own SqlGenerator class for insert statements that would surround the normal statement with the enable/disable statements. 

In 1.9, however, you may be able to by extending MssqlDatabase and overriding the execute method to see what is passed in and add you statements, but it won’t be as nice. 

I ran into the same problem lately and just wrote a script that parses the XML, them used xpath to find and add the nessesary nodes.  Not the nicest, but it worked.