2016-06-09 67 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