March 16, 2009 at 8:48 am
I am using Crystal Reports XI to retrieve data from a view I created in SQL 2005. When I execute a query on the view from SQL Server Management Studio, I get the desired results, but when I try to replicate the query in Crystal, I get the following error:
Failed to retrieve data from database.
Details: 42000 [Microsoft][SQL Native Client][SQL Server] Incorrect syntax near 'Index.' If this is intended as part of a table hint, a WITH keyword and parenthesis are now required. See SQL Server Books Online for proper syntax. Database vendor code: 1018
"Index" is a column name in my view, and I suspect this is the problem, but I do not know how to correct it.
Can anyone help?
March 16, 2009 at 9:16 am
Can you post the query?
Is the database that Crystal is querying in compat mode 90?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
March 16, 2009 at 9:19 am
Put a Square bracket around the column INDEX in the select statement
INDEX is a Keyword in SQL. So you do a select as
Select col1, col2, col3, [INDEX] from dbo.view
where YOURCONDITION
-Roy
March 16, 2009 at 9:20 am
Thank you for your reply.
I fixed the problem by renaming the column in my view to something else! Sometimes the best solutions are the simplest...
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply