[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Stroed Procedure not building

Posted on 2011-09-13
5
Medium Priority
?
256 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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 Backup & Restore 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.
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

656 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