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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T06:50:19+00:00 2026-05-16T06:50:19+00:00

I have a stored procedure that uses this select statement: SELECT dbo.VendorProgram.id, dbo.VendorProgram.CODE, dbo.Programs.ProgramName

  • 0

I have a stored procedure that uses this select statement:

SELECT dbo.VendorProgram.id, 
       dbo.VendorProgram.CODE, 
       dbo.Programs.ProgramName 
          + '-' + dbo.Divisions.Division 
          + '-' + dbo.Vendors.Source 
          + '-' + dbo.Mediums.Medium 
          + '-' + dbo.VendorProgram.content 
          AS SourceDetail, 
       dbo.Vendors.Source, 
       dbo.Programs.ProgramName, 
       dbo.Divisions.Division, 
       dbo.Mediums.Medium, 
       dbo.VendorProgram.content, 
       dbo.VendorProgram.url, 
       dbo.VendorProgram.cost, 
       dbo.VendorProgram.Notes, 
       dbo.VendorProgram.StartDate, 
       dbo.VendorProgram.EndDate
FROM dbo.Programs 
RIGHT OUTER JOIN dbo.VendorProgram 
                 ON dbo.Programs.id = dbo.VendorProgram.programID 
LEFT OUTER JOIN dbo.Vendors 
                 ON dbo.VendorProgram.vendorID = dbo.Vendors.mappingID 
LEFT OUTER JOIN dbo.Divisions 
                 ON dbo.VendorProgram.divisionID = dbo.Divisions.id 
LEFT OUTER JOIN dbo.Mediums 
                 ON dbo.VendorProgram.mediumID = dbo.Mediums.id

Basically we have a system that put together a code for a vendor. It is made up of 5 IDs pulled from 5 separate tables. Those tables have actual text, for a vendor’s name, a type of medium, etc… that match to each ID. So far nothing truly ground breaking in use here I think.

What I need to do is be able to write a query that uses paramaters, in text, to search those 5 separate tables, and find all the “vendor mappings” that could match. I am still new in the SQL world so I am not quite sure what that query would look like.

As an example of how I want to search. I enter into my search form the text “Face” for the vendor field. I would then expect the query runs a select against the vendor table itself to first find all possible vendor IDs with “face” in the name. Then it would need to select all rows from the combined table that have any of those IDs in them.

Hopefully this makes sense, and is possible. As always thanks for any help.

  • 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-16T06:50:20+00:00Added an answer on May 16, 2026 at 6:50 am
    SELECT vp.id, vp.CODE,  
        p.ProgramName + '-' + d.Division + '-' + v.Source + '-' + m.Medium + '-' + vp.content AS SourceDetail, 
        v.Source, 
        p.ProgramName, 
        d.Division, 
        m.Medium, 
        vp.content,  
        vp.url, 
        vp.cost,
        vp.Notes, 
        vp.StartDate, 
        vp.EndDate 
    FROM  dbo.Vendors v
    LEFT OUTER JOIN  dbo.VendorProgram vp vp.vendorID = v.mappingID 
    LEFT OUTER JOIN dbo.Programs p  ON p.id = vp.programID 
    LEFT OUTER JOIN  dbo.Divisions d ON vp.divisionID = d.id 
    LEFT OUTER JOIN  dbo.Mediums m  ON vp.mediumID = m.id 
    WHERE v.Name LIKE '%Face%'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 489k
  • Answers 489k
  • 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
  • Editorial Team
    Editorial Team added an answer yes. Leverage the fact that COUNT ignores NULL select count(distinct… May 16, 2026 at 8:55 am
  • Editorial Team
    Editorial Team added an answer Your data is poorly formatted for this purpose. Here's one… May 16, 2026 at 8:55 am
  • Editorial Team
    Editorial Team added an answer You should simply use php mail function with your form… May 16, 2026 at 8:55 am

Trending Tags

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

Top Members

Related Questions

No related questions found

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.