Last few days at work were pretty frustrating for me. I'm designing a Crystal report that is based on SQL stored procedure. I did it many times before and had no problems (what a typical opening for an IT issue, isn't it?).
In the stored procedure I have to use a statement that is similar to the following: EXEC "INSERT INTO [table_name] SELECT * FROM "+table_name_variable+" ". A table name here is the variable, because depending on user input, table name may vary.
If I run stored procedure in Query Analyzer it works well. But if I try to add it to my Crystal report, Crystal returns an error message "ODBC Error:[Microsoft][SQL Server]Incorrect syntax near the keyword 'FROM'". That happens with any procedure - even with the ones that work fine in other reports that I have created. It's happening on all workstations that have Crystal.
I have checked Report options and there are identical in the reports that work and the ones that don't work.
I'm puzzled.
In the stored procedure I have to use a statement that is similar to the following: EXEC "INSERT INTO [table_name] SELECT * FROM "+table_name_variable+" ". A table name here is the variable, because depending on user input, table name may vary.
If I run stored procedure in Query Analyzer it works well. But if I try to add it to my Crystal report, Crystal returns an error message "ODBC Error:[Microsoft][SQL Server]Incorrect syntax near the keyword 'FROM'". That happens with any procedure - even with the ones that work fine in other reports that I have created. It's happening on all workstations that have Crystal.
I have checked Report options and there are identical in the reports that work and the ones that don't work.
I'm puzzled.