SQL Server: Is it possible to insert into two tables at the same time?

后端 未结 11 1379
青春惊慌失措
青春惊慌失措 2020-11-22 16:22

My database contains three tables called Object_Table, Data_Table and Link_Table. The link table just contains two columns, the identi

11条回答
  •  臣服心动
    2020-11-22 16:43

    You still need two INSERT statements, but it sounds like you want to get the IDENTITY from the first insert and use it in the second, in which case, you might want to look into OUTPUT or OUTPUT INTO: http://msdn.microsoft.com/en-us/library/ms177564.aspx

提交回复
热议问题