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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:22:18+00:00 2026-06-14T22:22:18+00:00

I have an SQL database which I need to create a procedure or query

  • 0

I have an SQL database which I need to create a procedure or query that is linked to a web front end where the user can type in a value which will be in one of the columns of the database. The user types in the value, submits the command (just normal text entry in a textbox in the website), a query is ran in the background to view all persons who have this value in the column under their entry.
User entry to determine the outcome for a view of specific people.

SQL Side I have currently but not certain it is correct, works but not as intended!

I have a table with people in it and a model of interest value column.
Each model of interest is just a number 1-7 which relates to a product range in another table. So 1 = a Corsa, 2 = Astra, 3 = Vectra etc.
So in the persons table, they will have purely a 1 or a 2 etc. Now I need it to be linked to the model table so if it sees 1 it looks for Corsa rather than the number 1.

A user types in the frontend, select all users interested in a Corsa, it will look up the word corsa and match it to the value 1, then search for 1 in the model of interest column in the person table.

So far I have the following query. Any suggestions as I’m stumped for today. Will try again tomorrow.

SELECT TOP 100 [ld_idno]
      ,[ld_company]
      ,[ld_decisionmaker]
      ,[ld_decisionmaker_workphone]
      ,[ld_decisionmaker_mobile]
      ,[ld_decisionmaker_email]
      ,[ld_discussion_model]
  FROM [FMLive204].[dbo].[tblLeads]
SELECT  a.po_word
FROM    dbo.tblPopulation a
            INNER JOIN  dbo.tblLeads b
                ON ld_discussion_model = po_idno
                WHERE [po_word]='Corsa'

SELECT TOP 100 Unique Records
company name
customer name
customer workphone]
customer mobile]
customer email]
[ld_discussion_model] Model of interest = 1
FROM [FMLive204].[dbo].[tblLeads]
SELECT a.po_word
FROM dbo.tblPopulation a (table a)
INNER JOIN dbo.tblLeads b (table b)
ON ld_discussion_model = po_idno (if the model of interest 1 is the same as an entry in the other table, pick the value in the next columne (po_word)
WHERE [po_word]=’Corsa’

  • 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-14T22:22:19+00:00Added an answer on June 14, 2026 at 10:22 pm

    Daniel,

    Below I’ve outlined the stored procedure which would require the userdata (e.g. Corsa entered from the website) and return all fields from tblpopulation where ‘po_idno’ is in the list matched against the tblLeads. Not having the tblpopulation definition I’m guessing for field name ‘po_idno’ is the field which has the value 1-7 in it.

    Create PROCEDURE [dbo].[sp_find_person] (@UserData varchar(6))
    AS
    BEGIN
    
    
     SELECT Top 100 * FROM [FMLive204].[dbo].tblpopulation
    where po_idno in (SELECT po_idno FROM  dbo.tblLeads b
                JOIN   dbo.tblPopulation a
                    ON ld_discussion_model = po_idno
                    WHERE [po_word]=@UserData)
    

    Once you create the procedure you’ll have to execute it which more information can be found @ http://msdn.microsoft.com/en-us/library/ms189915.aspx

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

Sidebar

Related Questions

I have data in an SQL Server 2005 database which I need to copy
I have a Sql Database (which I have no control over the schema) that
I have a SQL Server database which I can read from, is there a
I have a stored procedure called WEB_SEL_SECURITY_QUESTIONS in my sql database which returns a
I have one SQL server database which was created using Import/Export Wizard from an
I have a SQL Server database which is shared between several ASP.NET (VB.NET) websites,
I have a SQL Server database which has grown to more than 15GB in
I have a ton of data in a sql database which I would like
I have an SQL database set up in which I would like to use
I I have a linq-to-sql database in which I want to log some of

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.