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:48

    Insert can only operate on one table at a time. Multiple Inserts have to have multiple statements.

    I don't know that you need to do the looping through a table variable - can't you just use a mass insert into one table, then the mass insert into the other?

    By the way - I am guessing you mean copy the data from Object_Table; otherwise the question does not make sense.

提交回复
热议问题