开发者

Sybase: programmatically turn off foreign key checks

开发者 https://www.devze.com 2023-01-03 10:32 出处:网络
I need to do bulk inserts/updates/deletes on a table-by-table basis via JDBC. Database is Syba开发者_JS百科se.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消