Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 940411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:57:08+00:00 2026-05-15T21:57:08+00:00

Here is my sample: ALTER PROCEDURE EmpFirstName @myParam int, @empFName varchar(20) output AS BEGIN

  • 0

Here is my sample:

ALTER PROCEDURE EmpFirstName
    @myParam int,
    @empFName varchar(20) output
AS
BEGIN
    SET NOCOUNT ON;

    SELECT @empFName = empfname
    FROM FE_QEMP
    WHERE empno = @myParam
END
GO

myParam is the input and empFName will carry the output, so the procedure
should only take 1 parameter since empFName is the output, but in my case
i get this error:

Msg 201, Level 16, State 4, Procedure
EmpFirstName, Line 0 Procedure or
function ‘EmpFirstName’ expects
parameter ‘@empFName’, which was not
supplied.

This is the way i called the procedure:

DECLARE @returnValue varchar(20)
EXEC @returnValue = EmpFirstName 10
SELECT 'Return Value ' = @returnValue
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T21:57:09+00:00Added an answer on May 15, 2026 at 9:57 pm

    Return values and output parameters are two different things. If you want to call it with an output parameter, you’d do it like this:

    EXEC EmpFirstName 10, @returnValue OUTPUT
    
    SELECT 'Return Value ' + @returnValue
    

    If you want to call it in the manner that you described in your example, then you need to alter the stored procedure to state RETURNS VARCHAR(20) and remove the output parameter. To return a value, you have to explicitly call return. In your example, you’d declare a variable, assign it in the select statement, then call return @varName.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my sample code. It is meant to be an iterative procedure for
I'm after a simple stored procedure to drop tables. Here's my first attempt: CREATE
I guess that I am missing something here. After having found this sample within
Here's sample model classes, which being use with Entity Framework Code First: public class
Here is sample data <table class=sparql border=1> <tr> <th>abstract</th></tr> <tr> <td> Cologne is Germany&#39;s
here the sample case.. i want to display banner randomly by percentage based on
Data: Here is sample table(TableA) data ID StartTime EndTime 1 2012-03-22 06:00:00.000 2012-03-22 06:30:00.000
Here is some sample Python code: import re some_regex = re.compile(r\s+1\s+) result = some_regex.search(
here is my sample html which is stored in a variable. var sHtml='' sHtml='<div
Here is the sample code that I ran on Visual Studio 2010: #include <iostream>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.