怎样判断临时表是否存在?如果存在就删除了它,要在adoquery1中写语句,怎么也写不对啊?(20分)

  • 主题发起人 主题发起人 wnsr
  • 开始时间 开始时间
W

wnsr

Unregistered / Unconfirmed
GUEST, unregistred user!
http://community.csdn.net/Expert/topic/4895/4895674.xml?temp=.7046625
找到了在查询分析器中的写法,在delphi中怎么写啊?
qy1.SQL.Text:='if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[#test]')) drop table[dbo].[#test] ';
qy1.ExecSQL;
这样写老是出错?
 
既然是临时表,用过后就没了,不用删除。
 
if exists (select * from dbo.sysobjects where id = object_id(N'[tempdb].[#test]')) drop table[dbo].[#test]
 
qy1.SQL.Text:='if exists (select * from tempdb...sysobjects where [name]=''#test'')) drop table #test ';
 
后退
顶部