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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:51:21+00:00 2026-06-16T03:51:21+00:00

I have the following stored procedure : SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON

  • 0

I have the following stored procedure :

 SET ANSI_NULLS ON
 GO
 SET QUOTED_IDENTIFIER ON
 GO
 ALTER PROCEDURE [dbo].[SearchMediaTitles] 

   @query varchar(50),
   @limit int = 6,
   @userId int
 AS
 SET FMTONLY OFF
 BEGIN

 declare @searchString varchar(52)

 set @searchString = '"' + @query +'*"'
 IF @userId!=NULL
 SELECT TOP (@limit) ID, Title from Media where CONTAINS([Title], @searchString)
 AND ID IN
  (
  SELECT FavoriteMedia_ID
  FROM dbo.UserMedia
  WHERE UserMedia_Media_ID=@userId
  )
 ELSE
 SELECT TOP (@limit) ID, Title from Media where CONTAINS([Title], @searchString)

 END

In Entity Framework when I try to map it at function import for a complex type it says

the selected stored procedure returns no columns

I’ve read about this on the internet and I found out I need to set SET FMTONLY OFF, but as you can see it didn’t work.

Any ideas?

EDIT:

I’ve changed SELECT to * and it return an empty result. I think it’s related to problem described above

  • 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-06-16T03:51:22+00:00Added an answer on June 16, 2026 at 3:51 am

    For everyone who has the same problem, this is what I’ve done.

    First I modified the stored procedure to a simple one like this :

      SELECT  [column1],[column2] FROM [table]
    

    I imported it in Entity Framework, created the complex type and mapping properties

    Then I changed it back and updated the model and now it works.
    I think Entity Framework has some problems with complex stored procedures. From what I read it can’t get results for dynamic stored procedures or for a stored procedure which use temp tables.

    PS: When I call it with Ajax, I call it using data.column1 and data.column2. If I use data.value' it returnsundefined` .

    It’s kinda weird.

    EDIT: It’s like Martin said but I don’t know why it didn’t worked in the first place ! Thank you btw !

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

Sidebar

Related Questions

I have the following stored procedure ALTER PROCEDURE [dbo].[sp_web_orders_insert] ( @userId int = default,
I have the following Stored Procedure ALTER PROCEDURE [dbo].[bt_BizForSale_GetByID] ( @ID int ) AS
I have the following stored procedure. ALTER PROCEDURE [dbo].[spList_Report] @id INT, @startDate DATETIME =
I have the following stored procedure: ALTER PROCEDURE [dbo].[spTitle_GetTitleById] ( @TitleId INT ) AS
I have written the following stored procedure: ALTER PROCEDURE [dbo].[sp_Accounts_ValidateLogin] @EmailAddress varchar(255), @Password varchar(20)
I have the following stored procedure: ALTER PROCEDURE Pro_members_Insert @id int outPut, @LoginName nvarchar(50),
Hi i have the following stored proc in SQL Server 2005: ALTER PROCEDURE [dbo].[slot_sp_EngineerTimeslots_Group]
I have a stored procedure in which if I write the following query without
I have to following sproc: USE [CW] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER
I have the following stored procedure: CREATEA PROCEDURE USP_U_Pricing ( @ProductId int ) AS

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.