且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用事务在具有主键和外键关系的2个表中插入值

更新时间:2023-01-29 09:31:47

基本上你不能在sql2005中的单个查询中更新多个表



但是,还有其他方法可以达到相同的效果 - 交易,触发器,输出......



看看这个链接的回复是否有些具体示例

http://***.com/questions/2044467/how-to-update-two-tables-in-one-statement-in-sql-server-2005 [ ^ ]
Essentially you can't update more than one table in a single query in sql2005

However, there are other ways to achieve the same effect - transactions, triggers, OUTPUT ...

Have a look at the responses to this link for some specific examples
http://***.com/questions/2044467/how-to-update-two-tables-in-one-statement-in-sql-server-2005[^]