Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot Run Stored Procedure through Crystal

Status
Not open for further replies.

kjaz11

Programmer
Sep 24, 2002
5
US
I have a simple stored procedure that accepts one integer parameter. The stored procedure works fine in query analyzer. The database is SQL server 2000. I use crystal all the time to retrieve data from tables and views, but when I try a stored procedure (through the same odbc connection) I get the following error.

ODBC Error: Syntax Error or Access violation

What is different in Crystal about running a stored procedure rather than a view? Or is this an odbc/sql server problem.

Any thoughts?

Thanks in Advance...
 
How is your Stored Procedure structured? The SP needs to return a dataset at the end of it. Please post the SP if it is not too large.

~Brian
 
Here is the stored procedure:

CREATE PROCEDURE [usp_PlayerLookup]

@piPlayerID AS integer

AS

SELECT FirstName,
MI,
LastName,
FROM dbo.tbl_Player
WHERE PlayerID = @piPlayerID

GO
 
Here is the stored procedure with correct syntax:

CREATE PROCEDURE [usp_PlayerLookup]

@piPlayerID AS integer

AS

SELECT FirstName,
MI,
LastName
FROM dbo.tbl_Player
WHERE PlayerID = @piPlayerID

GO
 
I am using SQL Server 2000. I am not finding reference to REF CURSOR for SQL Server. What am I missing?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top