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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:28:02+00:00 2026-05-23T08:28:02+00:00

I am in a process of converting some legacy SQL Server Stored Procedures to

  • 0

I am in a process of converting some legacy SQL Server Stored Procedures to EF4 using LINQ to Entites.
In one scenario i have a Stored Procedure that selects from 3 different Table_Valued Functions
like

 Select * from Function1 F1 ,Function2 F2, Function3 F3
 where F1.ID = F2.ID and
       F2.ID = F3.ID  (i am showing it simple)

where Function1 F1 ,Function2 F2 and Function3 F3 are 3 Sqlserver Table_Valued Functions
that returns table variables.

It would be great if some one could advice what is the best practice for this scenario,
Currently what i am doing now is have 3 different C# methods(which mimics the same functionality as that of SQL server function) which returns a collection and then join all those 3 collections together to get a final resultset.

Do we have an alternative solution to this as i think by using the above solution the code is calling 3 calls to the database instead of calling everthing together.

I would like the code to call one big SQL, instead of multiple calls.

Thanks in Advance !

  • 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-23T08:28:02+00:00Added an answer on May 23, 2026 at 8:28 am

    The main problem here is that EF doesn’t support table valued functions. Your solution have another terrible problem. Using three .NET functions simulating your functions actually calls the database three times (= most probably three sequential roundtrips to the database) but it also pulls whole result set for each function to your application and performs joins in memory of your application server. In most cases this is not acceptable.

    The proper solution depends on inner implementation of your functions because perhaps they can be converted either to linq-to-entities or ESQL. If not then you can still use the stored procedure! It is public secret of EF that it doesn’t replace stored procedures. They are still part of your arsenal when using it.

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

Sidebar

Related Questions

I am in the process of converting a legacy application from proprietary technology to
I'm in the process of converting some LaTeX documentation to restructured text and having
I am in the process of converting some code from C# to Java. I
I'm currently in the process of converting some small personal web sites from WebForms
I am in the process of converting some of our web services to MVC3
I am currently in the process of converting some excel VBA to C# and
We're in the process of converting web app to IE8 (now client is using
I'm in the process of converting my non secure socket to ssl, using boost::asio::ssl
I'm in the process of converting a varchar(8000) field to an xml field in
I was in the process of converting a VS2003 project (.NET 1.1) to VS2008

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.