一下脚本 在查询分析器中执行 没有错误 为什么 在 delphi 里面 用 Query 执行有错误里 ***** 该脚本 是我 在查询分析器中测试过的 然后 保存在表中 Query 执行时 也是从表中 查询出来的 经核对 没有错误的 请高手指点一下.
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[test_niubin]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[test_niubin]
GOSET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE procedure test_niubin
as
if exists(Select * from tempdb..sysobjects where name like '#SumDepProfitTable%')
drop table #SumDepProfitTableselect * into #SumDepProfitTable from r_DepProfit_Acct_niu
alter table #SumDepProfitTable add F111 money
alter table #SumDepProfitTable add F222 moneyselect * from #SumDepProfitTable
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[test_niubin]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[test_niubin]
GOSET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE procedure test_niubin
as
if exists(Select * from tempdb..sysobjects where name like '#SumDepProfitTable%')
drop table #SumDepProfitTableselect * into #SumDepProfitTable from r_DepProfit_Acct_niu
alter table #SumDepProfitTable add F111 money
alter table #SumDepProfitTable add F222 moneyselect * from #SumDepProfitTable
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
' if exists ( select * from sysobjects where name='+
QuotedStr('Tem_Att')+') drop table Tem_Att';
必须分两次执行