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

Related Questions

I have a stored procedure that has this line: SET @SQL = 'SELECT path,title,tags
I have a stored procedure with a SELECT statement that outputs one row. It
I have a stored procedure (that I didn't write) that uses openquery to populate
I have this stored procedure that I want to use for my SAP crystal
I have a stored procedure that logs some data, how can I call this
I have a stored procedure that uses a view to pull 6 averages. The
I have a MySQL stored procedure that uses a temporary table. Assume that my
I have a stored procedure that uses sp_executesql to generate a result set, the
We have a stored procedure that uses UDFs. We need to modify the content
I have a stored procedure that uses a FAST_FORWARD cursor to chronologically loop over

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.