Hi I have created a simple store procedure but going wrong somewher as am not getting the result expected.
Passing value to get output.. Please help as cannot study further until understood my mistake.
Mar 03, 2013 at 02:18 PM
Apr 17, 2013 at 12:47 PM
Change name = @Emp to @Emp = name
Try calling like this:
DECLARE @Emp nvarchar(20)
EXEC spGetNameByID 3, @Emp OUTPUT
Mar 03, 2013 at 02:28 PM
Mar 03, 2013 at 02:42 PM
yes it worked - am so happy question: don't i have to have different variable name like different when you request for parameters and different for declare to store values for output.
kindly go through this Link it might help and understood about SP
Different variable name? Not necessarily - due to what's called the "SCOPE" of a variable.
See http://en.wikipedia.org/wiki/Scope_(computer_science) for an overview.
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
Once you sign in you will be able to subscribe for any updates here
Answers and Comments
Need long-form SQL discussion? SQLserverCentral.com is the place.
asked: Mar 03, 2013 at 02:18 PM
Seen: 668 times
Last Updated: Mar 04, 2013 at 09:42 AM
how do i solve ?
Stored Procedure SQL Help
SQL Server 2008 and DB2 Stored procedures
Easy way to manage full database name in stored procedures and triggers?
can we provide output parameters and return statement to a SP at a time?
sum of fields from 2 different views
scalar variable declaration
Is there a way to change the columns to rows in a stored procedure?
How is best to persuade someone that stored procedures can outperform ORMs?
Stored Procedures - Urgent Help Needed