SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 OUTPUT parameter required?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

dthatcher
Starting Member

2 Posts

Posted - 10/11/2012 :  08:53:09  Show Profile  Reply with Quote
I have created the following stored procedure:

USE Northwind
GO
CREATE PROC spCheckContact
@cst nchar(5),
@TitleName varchar(10) OUTPUT
AS
{remainder of my sproc; deleted to prevent plagiarism}

When I attempted to run it like this:

EXEC spCheckContact 'ALFKI'

I get this error:

Msg 201, Level 16, State 4, Procedure spCheckContact, Line 0
Procedure or function 'spCheckContact' expects parameter '@TitleName', which was not supplied.


But @TitleName is specified as an OUTPUT parameter! How can I fix this?

Edited by - dthatcher on 10/14/2012 05:10:11

bandi
Flowing Fount of Yak Knowledge

India
2217 Posts

Posted - 10/11/2012 :  09:18:46  Show Profile  Reply with Quote

Try it.........

DECLARE @tit_name varchar(30)
EXEC spCheckContact 'ALFKI', @tit_name OUTPUT
PRINT @tit_name

--
Chandu
Go to Top of Page

dthatcher
Starting Member

2 Posts

Posted - 10/11/2012 :  09:34:56  Show Profile  Reply with Quote
Ah... so the output variable has to be supplied at execution. Thank you, that worked!
Go to Top of Page

bandi
Flowing Fount of Yak Knowledge

India
2217 Posts

Posted - 10/11/2012 :  09:36:07  Show Profile  Reply with Quote
quote:
Originally posted by dthatcher

Ah... so the output variable has to be supplied at execution. Thank you, that worked!



Welcome

--
Chandu
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000