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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:42:46+00:00 2026-05-12T07:42:46+00:00

I have a stored procudre (SP) as follows: CREATE PROCEDURE [dbo].[UDSPSelectMissing] — paramters omitted

  • 0

I have a stored procudre (SP) as follows:


CREATE PROCEDURE [dbo].[UDSPSelectMissing]
    -- paramters omitted
AS
BEGIN 
    -- Code Omitted
    SELECT 
        c.MemberID,
        c.FirstName,
        c.MiddleName,
        c.LastName,
        c.Suffix,
        c.PhoneHome,
        c.PhoneCell,
        c.Email
        FROM [dbo].[Members] c
        WHERE c.MemberID IN (SELECT MemberID FROM #PeopleCameMissing)
        ORDER BY c.LastName,c.FirstName
END

When I added the SP to the SP pane of “dbml” designer, I was expecting MSLinqToSqlGenerator to create “ISingleResult” as return value type. To my surprise, the return value type is “int”. Clearly, the generator is using certain criteria to determine the return value type. I have other similar SPs that returns “ISingleResult” type.

Does anybody know what would cause the generator to behave this way?

By the way, somebody on this site suggested recreating the SP, removing the reference from “dbml”, restarting Visual Studio (VS) and adding to it to “dbml” again. I went through all that to no avail.

My suspicion lies with the temporary table “#PeopleCameMissing”.

Any comments or suggestions are most welcome!

Thanks,

Cullen

  • 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-12T07:42:47+00:00Added an answer on May 12, 2026 at 7:42 am

    I mentioned in my original post that I suspected the temp table. The temp table was created by “SELECT INTO #PeopleCameMissing” command therefore its definition is dynamic so when the stored procedure is added to “dbml” designer, the generator has no clue about the table’s definition. What if I let the table definition known to the generator, maybe I’d be able to get the desired return type. Based on this conjecture, I ran a test. I declared a table as follows:

    
        DECLARE @PeopleCameMissing TABLE(
            MemberID int,
            FirstName nchar(20),
            MiddleName nchar(20),
            LastName nchar(20),
            Suffix nchar(10),
            PhoneHome nchar(20),
            PhoneCell nchar(20),
            Email  nchar(80)
        );
    

    And changed the original statement as follows:

    
        INSERT INTO @PeopleCameMissing (
            MemberID,
            FirstName,
            MiddleName,
            LastName,
            Suffix,
            PhoneHome,
            PhoneCell,
            Email)
        SELECT 
            c.MemberID,
            c.FirstName,
            c.MiddleName,
            c.LastName,
            c.Suffix,
            c.PhoneHome,
            c.PhoneCell,
            c.Email
            FROM [dbo].[Members] c
            WHERE c.MemberID IN (SELECT a.MemberID FROM #PeopleCameMissing a)
            ORDER BY c.LastName,c.FirstName;
    
        DROP TABLE #PeopleCameMissing;
    
        SELECT * 
            FROM @PeopleCameMissing 
            ORDER BY LastName,FirstName;
    
    

    And then I added the stored procedure to “dbml” designer again. This time the generator created the desired return type: “ISingleResult”. It seems to prove my conjecture.

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

Sidebar

Ask A Question

Stats

  • Questions 238k
  • Answers 238k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer No, but you might be able to simulate it by… May 13, 2026 at 6:43 am
  • Editorial Team
    Editorial Team added an answer set UIImagePickerController showsCameraControls property to NO. May 13, 2026 at 6:43 am
  • Editorial Team
    Editorial Team added an answer JRuby does not support native extensions. A related stackoverflow question… May 13, 2026 at 6:43 am

Related Questions

I have a stored procudre (SP) as follows: CREATE PROCEDURE [dbo].[UDSPSelectMissing] -- paramters omitted
I've read around the subject of temporary tables and scope and all the answers
How could a stored procdure run in 10 seconds via Management Studio, but take
Hi I have been working on a large matrix which displays the results of
I have a stored procedure in SQL 2005. The Stored Procedure is actually creating

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.