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

Problem with Stored Procedures

Status
Not open for further replies.

davek2

IS-IT--Management
Jul 9, 2001
1
US
Hi,

Im trying to have an aspx page call a Stored procedure that inserts a record into a database.

My stored procedure is relatively simple, it looks like this:

CREATE PROCEDURE sp_Insert_Data AS
INSERT INTO spHits (SPRNumber) VALUES ('Test')


Thats all it is and the syntax checks fine, but when the aspx page tries to run it I get this error:

Line 1: Incorrect syntax near 'sp_Insert_Data'.

Im pretty sure the syntax is correct. Any Ideas?

Thanks,
Dave
 
Hi.

I'm not sure, but try the following:

CREATE PROCEDURE [sp_Insert_Data]
AS INSERT INTO spHits (SPRNumber) VALUES ('Test')

May be the square brackets are missing. In SQL they have to be present.

regards, Kiri


 
does the sp run from query analyser? are you passing parameters to the sp or does it always write 'test'

Dave
adf999@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top