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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:22:21+00:00 2026-05-26T04:22:21+00:00

I want to do a join accross a MS-SQL and MySql database. The MS-SQL

  • 0

I want to do a join accross a MS-SQL and MySql database.

The MS-SQL query generates an index, effectively, and then I want to pull all MySQL records back that match the result of this query. (I could bring back both tables, i.e. the unfiltered data from MySQL and then filter using Linq, but this will be inefficient as I’ll be pulling back loads more data than I need.)

The MS-SQL query is done via Linq:

var fb1 = from f in db.tl_feedbacks  
          where f.timestamp >= new DateTime(fromYear, fromMonth, fromDay)
             && f.timestamp <= new DateTime(toYear, toMonth, toDay)   
          select new {f.requestID, f.tl_feedback_score.score };

This will bring back a table like this:

RequestID | score
-----------------
12345     | 1
12349     | 3
12446     | 3

etc.

From this I want to return only those records from the following MySQL query that have a RequestID in the above table:

SELECT wo.WORKORDERID,
       COALESCE(ti.FIRST_NAME,'Not Assigned') AS 'Technician',
       COALESCE(cd.CATEGORYNAME, 'Not Assigned') AS Category,
       COALESCE(scd.NAME, 'Not Assigned') AS Subcategory,
       wof.UDF_CHAR1 "Office Location"  
FROM WorkOrder_Threaded wot  
INNER JOIN WorkOrder wo ON wot.WORKORDERID=wo.WORKORDERID  
LEFT JOIN SDUser sdu ON wo.REQUESTERID=sdu.USERID  
LEFT JOIN AaaUser aau ON sdu.USERID=aau.USER_ID  
LEFT JOIN WorkOrderStates wos ON wo.WORKORDERID=wos.WORKORDERID  
LEFT JOIN SDUser td ON wos.OWNERID=td.USERID  
LEFT JOIN AaaUser ti ON td.USERID=ti.USER_ID  
LEFT JOIN CategoryDefinition cd ON wos.CATEGORYID=cd.CATEGORYID  
LEFT JOIN SubCategoryDefinition scd ON wos.SUBCATEGORYID=scd.SUBCATEGORYID  
LEFT JOIN WorkOrder_Fields wof ON wo.WORKORDERID=wof.WORKORDERID  

i.e I only want to pull back records 12345, 12349 and 12446 in this example. Ultimately I want one single table which has the requestID, score, and the columns from the MySQL query. However, if I can get the “filtered” MySQL table back I can join the two afterwards. I just don’t want to bring the MySQL back “unfiltered” as the table will be huge.

  • 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-26T04:22:22+00:00Added an answer on May 26, 2026 at 4:22 am

    With the right OLEDB database drivers (I’ve only done this with PGSQL so I can’t really advise), you can create a Linked Server in MSSQL. Here’s a walkthrough, and here’s another.

    You can then query it using OPENQUERY as follows in MSSQL:

    select * from openquery(LinkedServerDb,'select * from remotetable')
    

    and join:

    select 
        * 
    from 
        openquery(LinkedServerDb,'select * from remotetable') remoteTable
        join localTable on remotetable.someid=localtable.otherid
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to join all lines in a file into a single line. What
I have an array of threads, and I want to Join them all with
I have four tables in my database and i want to join that's and
I want to join records together and separate them with - I know how
I want to join 2 tables 'addresses' and 'user_info' on user_id and app_id (which
I want to join two strings each representing a relative URL in Javascript. I
Say I have two tables I want to join. Categories: id name ---------- 1
I have two tables which I want to join together using a left outer
Hi i want to display join result of two tables but don't want to
I want to update a column in a table making a join on other

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.