2016-06-09 65 views
1

我尝试通过stimulsoft获取pdf报告,但得到此错误。“@StartDate”附近语法不正确。声明无法准备

“@StartDate”附近语法不正确。声明(S)可能不准备

我在测试我的sqlserver存储过程和表函数和currently.but工作时,我尝试在词典窗口中运行VeiwData让我这个错误。 查询文本中stimulsoft:

execute ProceGetCharterReportPdf (@StartDate,@endDate,@top,@AgencyName) 

@StartDate,@endDate,@AgencyName类型是@top为nvarchar在报告文件和存储过程和函数。键入是int

+4

删除括号。 – GSerg

+0

行它解决了.. – programmer138200

回答

0

它会听起来很愚蠢,但如果您正在调用函数,请尝试添加模式名称;

execute dbo.ProceGetCharterReportPdf(@StartDate,@endDate,@top,@AgencyName) 

调用函数时,您必须使用模式名称我相信,下面进一步阅读;

Is it possible to call a user-defined function without the schema name?

Is there a way to use a function on a Microsoft SQL Server Query without using "dbo." before the function?

+0

我删除括号并解决。 – programmer138200

+0

根据[语法](https://msdn.microsoft.com/en-us/library/ms188332.aspx),执行字符串或变量时需要括号,并且在调用存储对象时不允许使用括号。 – GSerg