1

I try to get pdf report by stimulsoft but get this error.

Incorrect syntax near '@StartDate'. Statement(s) could not be prepared

I test my stored procedure and table function in sqlserver and worked currently.but when I try to run VeiwData in dictionary window get me this error. Query text in stimulsoft :

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

Type of @StartDate,@endDate,@AgencyName is nvarchar in report file and stored procedure and function .Type of @top is int.

hmahdavi
  • 2,250
  • 3
  • 38
  • 90

1 Answers1

0

It's going to sound daft, but try adding your schema name if you're calling a function;

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

You have to use the schema name when calling a function I believe, some further reading below;

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?

Community
  • 1
  • 1
Rich Benner
  • 7,873
  • 9
  • 33
  • 39
  • According to the [grammar](https://msdn.microsoft.com/en-us/library/ms188332.aspx), parentheses are required when executing a string or a variable, and not allowed when calling a stored object. – GSerg Jun 09 '16 at 08:05