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 6806871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:45:47+00:00 2026-05-26T19:45:47+00:00

I am working one something and I can’t get it to work. I am

  • 0

I am working one something and I can’t get it to work. I am trying to Create a user defined function named Employee_Name. Pass an Employee Id as a parameter.Return the First Name, Last Name, and Phone Number of the employee whose ID matches the id passed to the user defined function.Create a query that uses the function and returns information for the employee with an id of 5. But In order to finish the function employee name I can not get it to work. I keep getting this error:

Msg 207, Level 16, State 1, Procedure Employee_Name, Line 10
Invalid column name 'Employee_Name'.
Msg 208, Level 16, State 1, Line 2
Invalid object name 'Employee_name'.

The code looks like this:

   CREATE FUNCTION Employee_Name 
(
    @EmployeeID int 
)
RETURNS TABLE
AS
RETURN
(
    SELECT * FROM Employees
    WHERE Employee_Name = @EmployeeId
)
GO

SELECT * FROM Employee_name (1)

Now to get the Return on First name,lastname and phone wouldnt I so a select on the employees id where it goes like this

Select 
FirstName,
LastName,
PhoneNumber
From EmployeeId

Or something like that.Now to get the employee with and Id of 5 would i use the count or do something that has an =5; I am not to sure still confused.

Edit: This is what I have again:

    CREATE FUNCTION Employee_Name 
(
    @EmployeeID int 
)
RETURNS TABLE
AS
RETURN
(
    SELECT FirstName,LastName,HomePhone
    FROM Employees
    WHERE Employee_Name = @EmployeeId
)
GO
  • 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-26T19:45:48+00:00Added an answer on May 26, 2026 at 7:45 pm

    This line:

    WHERE Employee_Name = @EmployeeId
    

    does not make sense. Surely you mean something like

    WHERE Employees.EmployeeId = @EmployeeId
    

    ?

    And this query:

    Select 
    FirstName,
    LastName,
    PhoneNumber
    From EmployeeId
    

    should surely be this:

    SELECT FirstName,
           LastName,
           PhoneNumber
      FROM Employees
     WHERE EmployeeId = ...
    

    ?

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

Sidebar

Related Questions

I'm trying to create a drop down button and its almost working except one
I'm trying to create a system where you can drag and resize divs (jquery
I am working on one small project - web site. There are gallery, user
My UITableViewCells can accept input of data. While working in one cell, it would
I've been working quite a bit on something I can only describe as a
I'm trying to create an object in a function, but I am running into
I'm working with one legacy application written in VB5, and I need to give
I am working on one real estate website which is Using RETS service to
I'm working on one of those projects where there are a million better ways
Right now I am working on one Real Estate Website, In that website I

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.