query1.sql.add('if exists(select 1 from dbo.sysobjects where object_id('tempdb..#temp') is not null) drop table #temp')
谢谢,,我现在就试! 这个tempdb代表什么?
踏网无痕的那个运行,出错:tempdb 前缀 无效,无表名
列前缀tempdb无效,未指定表名,,请问,这个表名指的是那个名字呢,应该加到什么地方呢?谢谢
老忘了单引号,不好意思 query1.sql.add('if exists(select 1 from dbo.sysobjects where id=object_id('tempdb..#temp')) drop table #temp')
query1.sql.add('if exists(select 1 from dbo.sysobjects''') ; query1.sql.add('where object_id('''+'tempdb..#temp'+''') is not null) drop table #temp') ;这样才行
tempdb就是企业管理器中的tempdb数据库,用来保存临时表的
呼救猫,的query1.sql.add('if exists(select 1 from dbo.sysobjects''') ;没看懂,是否少了“)”,,系统给我提示错误:Missing right quote
query1.sql.add('if exists(select 1 from dbo.sysobjects where id=object_id('tempdb..#temp')) drop table #temp')
query1.sql.add('where object_id('''+'tempdb..#temp'+''') is not null) drop table #temp') ;这样才行