是SQL SERVER 在DELPHI里用了ADOQUERY ADOQUERY1.CLOSE; ADOQUERY1.SQL.CLEAR; ADOQUERY1.SQL.ADD('select * into #temptable from tablename where......');然后我想对刚形成的#temptable进行SELECT查询,怎么进行?我刚试了,为什么说不存在这个临时表?
断开数据库连接,临时表就会自动清除了。 try// adoquery1.close; adoquery1.sql.clear; adoquery1.sql.add('insert into #temp select * from tablename'); adoquery1.sql.add('select * from #temp'); adoquery1.execsql;
在DELPHI里用了ADOQUERY
ADOQUERY1.CLOSE;
ADOQUERY1.SQL.CLEAR;
ADOQUERY1.SQL.ADD('select * into #temptable from tablename where......');然后我想对刚形成的#temptable进行SELECT查询,怎么进行?我刚试了,为什么说不存在这个临时表?
try//
adoquery1.close;
adoquery1.sql.clear;
adoquery1.sql.add('insert into #temp select * from tablename');
adoquery1.sql.add('select * from #temp');
adoquery1.execsql;
2。MSSQL创建的临时表好象不是在当前库中的,有一个系统的临时数据库吧?要USE一下