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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error in executing a stored procedure..

Status
Not open for further replies.

asknelson19

Programmer
Jul 19, 2007
14
US
I am getting an error
"[Microsoft][ODBC SQL Server Driver]Syntax error or access violation" when I am executing the following stored procedure...

SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

ALTER PROCEDURE UPDATE_AGENCY_TM
@AGENCY_NAME NVARCHAR(50),
@SALES_REP VARCHAR(15),
@EFFECTIVE_DATE DATETIME
AS
SET NOCOUNT ON
IF (((SELECT * FROM DBO.AGENT WHERE @AGENCY_NAME=NAME) IS NOT NULL)
AND ((SELECT * FROM DBO.TRR_MGR WHERE @SALES_REP=SALES_REP) IS NOT NULL))
THEN
{
INSERT INTO DBO.AGENCY_TM (PK_NBR,NAME,SALES_REP,EFF_DATE) VALUES(12,@AGENCY_NAME,@SALES_REP,@EFFECTIVE_DATE)

}

GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

;;;;;any help will be appreciated..
 
Please post in the SQL Server forum, this is for Crystal.

Your SP doesn't return any data. CR isn't designed to be an application de3velopment platform for inserts,m it is intended to do reporting, so it expects you to return data.

Try adding a:

SELECT * FROM DBO.AGENT WHERE @AGENCY_NAME=NAME

at the end so that you get data returned.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top