?
Solved

Stroed Procedure not building

Posted on 2011-09-13
5
Medium Priority
?
252 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 5

Accepted Solution

by:
zvytas earned 668 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 668 total points
ID: 36530040
your parms should have @

@ID int,
@IRBSubmittedDate nvarchar(50)

0
 
LVL 29

Assisted Solution

by:Paul Jackson
Paul Jackson earned 664 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

777 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