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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T05:54:19+00:00 2026-06-06T05:54:19+00:00

Any ideas how I can create a join on a table retrieved from data

  • 0

Any ideas how I can create a join on a table retrieved from data in a previously joined table? For example, I have an objects table that contains existing table Names, the display field of those tables, and the main ID field of those tables. I want to join on the table specified in the objects table as well as the objects table.

 select T.field1,T.field2,T.field3,O.DisplayName
 from tableT as T
 inner join objects as O on T.SystemObjectID = O.SystemObjectID
 inner join O.TableName as X on X.O.ID = T.SystemObjectRecordID

I understand the script above is not correct. But what is the easiest most efficient way of accomplishing this task? I hope I’m clear on what I’m asking…

Thank you for any help in advance.

  • 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-06T05:54:21+00:00Added an answer on June 6, 2026 at 5:54 am

    You can’t do that.

    What you can do is take the results of that and create a string that is a SQL query.

    You can even make that query parameterised and execute it using sp_executesql.
    – That link has a few good examples to get you started.

    This is because SQL is compiled to an execution plan before it is executed. At this point in time it needs to know the tables, decides the indexes to use, etc.

    This means that data is data and sql is sql. You can’t use late binding scripting tricks to modify the query that is already running.

    You’re stuck with SQL that writes SQL (Dynamic SQL) I’m afraid.

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

Sidebar

Related Questions

I don't have any idea how can I create a custom UIPickerView with an
Does anyone have any idea on how can you create a product filtering query
Anyone have any ideas what I can do? Please reserve commenting about using 1.1
Do you have any ideas where to find a PHP class (library) which can
I have a table that contains procedure codes among other data (let's call it
I've got 2 tables that I need to get data from...my users table looks
I have a SQL statement: select t3.item1, t3.item2, sum(t1.moneys) from table t1 inner join
Any ideas where can I find a free (trial or for educational purposes) WebSphere
Any ideas of how best i can implement article revision history for a Java
Just wondering if anyone has any ideas on how we can style templates... Like

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.