sqlserver 批量插入
程序员文章站
2022-05-19 13:36:07
...
我写点伪代码: private InsertData(){ var StartId = exec("select max(id) from table1"); for(var i =1;i10;i++){ exec("insert Table1(Name) values('Name"+i.ToString()+"')") } var EndId = exec("select max(id) from table1"); for(var i =StartId;i
我写点伪代码:
private InsertData(){
var StartId = exec("select max(id) from table1");
for(var i =1;i
exec("insert Table1(Name) values('Name"+i.ToString()+"')")
}
var EndId = exec("select max(id) from table1");
for(var i =StartId;i
exec("insert Table2(MainId) values('"+i.ToString()+"')")
}
}