首先判断这个表是否荐在,然后在建立,我要创建一个临时表用以下的方法不可以,不知各位还有什么别的方法,数据库为sql6.5:
tempado.SQL.Add('if exists(select * from sysobjects where name='+char(39)+'#temptable1'+char(39)+')');
tempado.SQL.Add('begin ');
tempado.SQL.Add(' drop table temptable1');
tempado.SQL.Add('end');
tempado.ExecSQL;
tempado.SQL.Clear;
tempado.SQL.Add(' create table #temptable1(c1 float NULL default null ,c2 float NULL ,c3 float NULL,c4 float NULL,c5 float NULL )' );
tempado.ExecSQL;
tempado.SQL.Add('if exists(select * from sysobjects where name='+char(39)+'#temptable1'+char(39)+')');
tempado.SQL.Add('begin ');
tempado.SQL.Add(' drop table temptable1');
tempado.SQL.Add('end');
tempado.ExecSQL;
tempado.SQL.Clear;
tempado.SQL.Add(' create table #temptable1(c1 float NULL default null ,c2 float NULL ,c3 float NULL,c4 float NULL,c5 float NULL )' );
tempado.ExecSQL;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货