Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
mjjuk
Helper I
Helper I

how to limit SQL query loads from another table?

Hi All, 

 

I am trying to load a table from an ODBC database but only bring in the values from a salesforce table I have loaded in .....

I have a column in the Salesforce table called "job Number"     (roughly 100k job numbers) I have been told that is too much for a keylist.

 

The ODBC table has millions of job numbers

I want to be able to run the ODBC SQL query to only bring back the job numbers in the Salesforce table  

 

 

The keylist way meant I used applied steps and brought in the Saleforce table then removed all other columns, then created a new column "'"&[Job Numbers]&"'" then combined to create the keylist... then in the SQL I wrote

Select 

job number,

visit report,

visit number,

status

from database.table2

where job number IN ("'"&[keylist]&"'")

 

it works fine for a small number but affects performance with larger data sets ..... I am hoping I have explained this well, I really could do with a more efficiant way 

 

2 REPLIES 2
d_gosbell
Super User
Super User

If you can, the most efficient way to do this would be to load the Salesforce job numbers into a table in your other database. Then you could do a simple join between the two data sets. Optimizing joins across data stored in different physical sources is difficult. At some point you have to get the data into a common location so that you can do the comparison.

I was hoping some sort of WHERE clause could be used but I dont know how to reference the Salesforce table in SQL

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.