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

  • Home
  • SEARCH
  • 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 4085288
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:33:20+00:00 2026-05-20T18:33:20+00:00

I have a function that takes 2 parameters and return a table. Is it

  • 0

I have a function that takes 2 parameters and return a table.
Is it possible to use this function in a select and show the 3 columns that it returns?
This is my query:

select a.PersonId, b.Passportnumber, dbo.fn_Passport(a.PersonId)
from Person a

thanks

  • 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-20T18:33:21+00:00Added an answer on May 20, 2026 at 6:33 pm

    For SQL Server 2005+, you can use the APPLY operator

    select a.PersonId, b.Passportnumber, p.col1, p.col2, p.col3
    from Person a
    OUTER APPLY dbo.fn_Passport(a.PersonId) p
    

    I have assumed the column names are col1, col2, col3 for illustration.

    You use CROSS APPLY when the function must return 1 or more rows to retain the Person record. Use OUTER APPLY to keep the Person record even if the function results in no rows. Basically

    CROSS APPLY similar to INNER JOIN
    OUTER APPLY similar to OUTER JOIN
    

    How to use APPLY

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

Sidebar

Related Questions

I have a function that takes 2 parameters : 1 = XML file, 2
I have a calc function in java script that takes three integer parameters, following
I have a function called Colorbox (jQuery plugin) that takes a number of parameters
So we have this SYS_CONTEXT function in Oracle, which takes two parameters, first a
I have a function that currently takes in two template parameters. One is expected
I have a JavaScript function that takes two required parameters and then arbitrarily many
I have a function that returns an object with parameters like so: public static
I have a function that takes as parameters 2 instances of a (custom) class.
I have a function that takes a couple of font parameters, and produces the
I have this function below that takes a list of id's and searches the

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.