SQLserver数据库中有table1,table2两个表。
假如table1中有个字段content和flag,表中有10万左右的记录。
table2为空表。里面有个字段cont2。我想取出select content from table1 where flag is not null的纪录,然后把这些记录的content
写入table2的cont2。
如果用Recordset 1条1条进行循环,这样占有系统资源太大,并且速度也不快。现在请教怎样更好的解决这个问题。
假如table1中有个字段content和flag,表中有10万左右的记录。
table2为空表。里面有个字段cont2。我想取出select content from table1 where flag is not null的纪录,然后把这些记录的content
写入table2的cont2。
如果用Recordset 1条1条进行循环,这样占有系统资源太大,并且速度也不快。现在请教怎样更好的解决这个问题。
里写insert into table2(cont2) select content from table1 where flag is not null
query1.sql.clear;
query1.sql.add('insert into table2(cont2) select content from table1 where flag is not null');
query1.execsql;