如何运行此SQL语句sp_configure'显示高级选项',1;在水晶报表中?

问题描述

这是不在Crystal Report中运行的代码

错误:无法从数据库检索数据。详细信息:ADO错误代码0x80040e14源Microsoft sql Server本机客户端11.0说明:isp_configure附近的语法不正确。 sql状态42000本机错误:102 [数据库供应商代码:102

enter image description here

  Declare @ReportDate DateTime
Set @ReportDate={?ReportDateR}

Select * from [SBO_SPEL].[dbo].[U_SPEL_SALES_ANALYSIS_TARGET&ACTUAL_UNIT_F] (@ReportDate)

UNION ALL

Select * from [SBO_SPEL].[dbo].[U_SPEL_SALES_ANALYSIS_TARGET&ACTUAL_SE_F] (@ReportDate)
GO


sp_configure 'show advanced options',1;
GO
RECONfigURE;
GO
sp_configure 'max server memory',32768;
GO
RECONfigURE;
GO


WAITFOR DELAY '00:02:00'
GO

sp_configure 'show advanced options',131072;
GO
RECONfigURE;
GO

解决方法

Crystal将命令或SP中最后一条SQL语句的结果集返回到报告中。但是您的最后一条SQL语句没有结果集。