Sybase: programmatically turn off foreign key checks
I need to do bulk inserts/updates/deletes on a table-by-table basis via JDBC. Database is Syba开发者_JS百科se.
Because of FK checks, I can't do this, because I temporarily violate integrity.
In MySQL I can easily turn off and on constraint checks, by issuing a simple command.
Is there some way to do the same in Sybase?
Thanks.
It is standard where I work to break up the DDL into Table, Constraints, and then Indexes; each element only calling CREATE if the object didn't exist. You could create a stored procedure that drops key constraints, and then simply run the DDL after you are done with your bulk insert/update/delete.
精彩评论