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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:24:42+00:00 2026-05-13T08:24:42+00:00

Why can the Linq to SQL designer not understand the following stored procedure and

  • 0

Why can the Linq to SQL designer not understand the following stored procedure and import it correctly?

CREATE PROCEDURE dbo.MartinTest
    @parameter1 INTEGER

AS
    SET NOCOUNT ON

    SELECT C1, C2, C3 
    INTO #myTempTable
    FROM MyTable

    SELECT C1, C2, C3
    FROM MyOtherTable INNER JOIN #myTempTable ON ....

    RETURN

When I use the designer to import this stored procedure, it sets the return type as “none”, even though the SP clearly returns one or more rows of data.

Whereas, if I remove the first select statement and instead simply return the content of the original table…

CREATE PROCEDURE dbo.MartinTest
    @parameter1 INTEGER

AS
    SET NOCOUNT ON

    SELECT C1, C2, C3
    FROM MyTable

    RETURN

…the designer works fine and determines the correct return type.

BTW: I know I can manually code the call to the stored procedure so I am not looking for a work-around, I am more interested as to whether this is a bug in the designer for Linq to SQL or whether it is something else. I am using VS2008 SP1.

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-13T08:24:43+00:00Added an answer on May 13, 2026 at 8:24 am

    This is not technically an issue with the Linq to SQL designer, it is an issue with SQL Server. Linq to SQL designer uses SET FMTONLY ON to get the result set information of a stored procedure. Unfortunately, this method does not work when the stored procedure has a temporary table.

    There is a small back and forth regarding this in the first few comments of ScottGu’s blog post.

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

Sidebar

Related Questions

I am using Linq to SQL to call a stored procedure which runs a
In LINQ to SQL, I can create a repository dynamically using DataContext.GetTable<T> . Is
I have a stored procedure that returns two int Values. The first can not
How can I create LINQ to SQL request where I can use group by
I used the LINQ to SQL designer in Visual Studio to create an object
I am wondering if you can use Linq to SQL using a .mdf file
Since I'm using Postgresql and can't use LINQ to SQL, I wrote my own
how can the ThenBy be translated to Linq-To-Sql , please? var movies = _db.Movies.Orderby(c
How can we handle concurrency errors in LINQ to SQL?
How can I use table hints in LINQ to SQL when calling submit changes

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.