Solved

Stroed Procedure not building

Posted on 2011-09-13
5
249 Views
Last Modified: 2012-05-12
I have created a stored proc to update one filed in my DB and all the others work just not this one anyone have any ideas?


set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
Create PROCEDURE [dbo].[P_sp_SubmittedDateIRBUser]
	/*
	(
	@parameter1 int = 5,
	@parameter2 datatype OUTPUT
	)
	*/

ID int,
IRBSubmittedDate nvarchar(50)

AS
	/* SET NOCOUNT ON */
	UPDATE tbl_info
	SET IRBSubmittedDate = @IRBSubmittedDate

	WHERE ID = @ID
	RETURN
Msg 102, Level 15, State 1, Procedure P_sp_SubmittedDateIRBUser, Line 9
Incorrect syntax near 'ID'.
Msg 137, Level 15, State 2, Procedure P_sp_SubmittedDateIRBUser, Line 15
Must declare the scalar variable "@IRBSubmittedDate".

Open in new window

0
Comment
Question by:HawaiiDragon
5 Comments
 
LVL 5

Accepted Solution

by:
zvytas earned 167 total points
ID: 36530024
Try the following:

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
Create PROCEDURE [dbo].[P_sp_SubmittedDateIRBUser]
      /*
      (
      @parameter1 int = 5,
      @parameter2 datatype OUTPUT
      )
      */
(
@ID int,
@IRBSubmittedDate nvarchar(50)
)
AS
      /* SET NOCOUNT ON */
      UPDATE tbl_info
      SET IRBSubmittedDate = @IRBSubmittedDate

      WHERE ID = @ID
      RETURN
0
 
LVL 13

Assisted Solution

by:Philip Pinnell
Philip Pinnell earned 167 total points
ID: 36530040
your parms should have @

@ID int,
@IRBSubmittedDate nvarchar(50)

0
 
LVL 29

Assisted Solution

by:Paul Jackson
Paul Jackson earned 166 total points
ID: 36530059
I assume that the below 2 lines are parameters being passed into the stored procedure :

ID int,
IRBSubmittedDate nvarchar(50)

you need to put some brackets round them and put an @ symbol in front.
(
@ID int,
@IRBSubmittedDate nvarchar(50)
)
0
 

Author Closing Comment

by:HawaiiDragon
ID: 36530152
Man what a "duh" moment for me... guess thats what 2 hours of sleep a night can do to you. Thanx guys!!!
0
 
LVL 13

Expert Comment

by:Philip Pinnell
ID: 36530317
Thanks
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that undeā€¦

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question