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 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

Related Questions

I have stored procedure like CREATE procedure [dbo].[spAddItem] ( @itemId nvarchar(50), @itemName nvarchar(500), @itemDescription
I have stored-procedure in Oracle database like this: create or replace PROCEDURE EDYTUJ_PRACOWNIKA (PR_IMIE
I have stored procedure : ALTER PROCEDURE [dbo].[proc_GetApplicationByCostCentreId] ( @CostCentreId TINYINT, @DepartmentId INT =
Consider the following psuedo T-SQL code (performed by a stored procedure): CREATE TABLE #localTable
I have stored procedure: ALTER PROCEDURE [dbo].[k_ShoppingCart_DELETE] @cartGUID nvarchar AS DELETE FROM [dbo].[k_ShoppingCart] WHERE
I have stored 6 records in mysql db,when i use this code each of
I have this stored procdure CREATE PROC dob.p_foobar ( @foo bit = NULL, @Bar
I have stored procedure (unorganized - not properly outlined) I want automatic outlining in
I have stored procedure getList(@date datetime) how programmatically execute stored procedure for differend datetime
I have stored procedure that calls another stored procedure. Let's call them OUTER and

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.