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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T15:50:11+00:00 2026-05-10T15:50:11+00:00

Problem: Ajax suggest-search on [ n ] ingredients in recipes. That is: match recipes

  • 0

Problem:

Ajax suggest-search on [n] ingredients in recipes. That is: match recipes against multiple ingredients.

For instance: SELECT Recipes using 'flower', 'salt' would produce: 'Pizza', 'Bread', 'Saltwater' and so forth.

Tables:

Ingredients [     IngredientsID INT [PK],     IngredientsName VARCHAR ]  Recipes [     RecipesID INT [PK],     RecipesName VARCHAR ]  IngredientsRecipes [     IngredientsRecipesID INT [PK],     IngredientsID INT,     RecipesID INT ] 

Query:

SELECT     Recipes.RecipesID,     Recipes.RecipesName,     Ingredients.IngredientsID,     Ingredients.IngredientsName FROM     IngredientsRecipes      INNER JOIN Ingredients     ON IngredientsRecipes.IngredientsID = Ingredients.IngredientsID      INNER JOIN Recipes     ON IngredientsRecipes.RecipesID = Recipes.RecipesID WHERE     Ingredients.IngredientsName IN ('salt', 'water', 'flower') 

I am currently constructing my query using ASP.NET C# because of the dynamic nature of the WHERE clause.

I bites that I have to construct the query in my code-layer instead of using a stored procedure/pure SQL, which in theory should be much faster.

Have you guys got any thoughts on how I would move all of the logic from my code-layer to pure SQL, or at least how I can optimize the performance of what I’m doing?

I am thinking along the lines of temporary tables:

Step one: SELECT IngredientsID FROM Ingredients and INSERT INTO temp-table

Step two: SELECT RecipesName FROM Recipes joined with IngredientsRecipes joined with temp-table.IngredientsID

  • 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. 2026-05-10T15:50:12+00:00Added an answer on May 10, 2026 at 3:50 pm

    You have two options. If you’re using SQL Server 2008 (or Oracle) you can pass in a table value parameter.

    If you’re using SQL Server 2005, you can use XML to simulate this capability

    If you’re using something earlier than 2005, you need to concatenate the ids in a single string and create a UDF to parse them.

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

Sidebar

Ask A Question

Stats

  • Questions 73k
  • Answers 74k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

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

    • 7 Answers
  • Editorial Team

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

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer It will take several weeks to change over to a… May 11, 2026 at 2:12 pm
  • added an answer Many projection libraries, such as Proj.4 and libraries using it… May 11, 2026 at 2:12 pm
  • added an answer You need to remove the event listener, or you can… May 11, 2026 at 2:12 pm

Related Questions

Of course I am aware of Ajax, but the problem with Ajax is that
I have a problem in giving Ajax functionality to a hyperlink. I have files
I have strange problem with sharepoint and ajax functionality. We have an UpdatePanel placed
In trying to solve the ajax back button problem I have found the Really
Good evening/morning/after/noon. I have an ASP.net 3.5 website and I am using vb.net in
Here is my issue. I have an array containing the name of cities that
I'm appending some HTML containing javascript. <td onclick=toggleDay('+data+',this,\'tue\');>T</td> and <img src=img/cross.png onclick=deleteAlarm('+data+');> These two
I'm using Google Ajax API and they suggest I use google.setOnLoadCallback() to do various

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.