Solved

Stroed Procedure not building

Posted on 2011-09-13
5
246 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
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 seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now