Joining SQL Database Table with Excel Sheet Data Using Power Query - sql

I'm accessing a table in a SQL database through Excel Power Query and I want to do a join with some data that I have in a excel sheet. I don't have write access to the database so I'm not able to just create a table with the Excel data there.
Is there a good workaround that would allow me to join the database table with the data in the Excel sheet?

If you load the data from the SQL database in a query you can merge it with another query in the power query editor. You just have to navigate to the power query editor and find the merge button.
The editor will ask which are the two queries you want to merge and to indicate which columns contain the matching data.
Several types of join are supported.

Related

Can you use excel lookup table in SQL database pull?

Is there a way to import a lookup table of account numbers from excel and only pull results from the database that match the account numbers listed in the excel lookup table? My lookup table contains thousands of account numbers so I can't manually type in the results that I want to filter for. I am using Microsoft SQL server studio to pull data from a SQL server database.
Yes, from SSMS in the object explorer you can right click on the database Tasks-->Import Data. From there you can use the UI to import the spreadsheet as a table in your database.

How to Overwrite Database Table Data Using SQL Server Data Tools

I'm currently working on a small project using sql data tools. I'm getting data from excel sheet and write it back to my database table. from the database table I'm generating a report. Time to time I'm updating my excel sheet. but it won't update in my database table. how do I clear the table and rewrite excel sheet data to database table when run the project every time?
post build script would be how and when I would clear or synchronize the data. Then you have to write the truncate or delete and the insert and/or update sections to move data from your excel document to the sql table. I would suspect that the SQL table is a better place to maintain the data though!!! If you maintain in SQL you can always have a query to see what it is in Excel at any given time and you don't have to worry about synching back to SQL.

Updating a table based on an Excel file without excel functionality?

Okay, so I basically have a huge excel list with two columns, ID and Value. I'd like to update an Employee table in my SQL and set a column in that table equal to the Value from the excel file where the ID of the excel file is equal to the ID of the Employee table.
I've looked at other similar questions and they use OpenRowSet and other SQL excel functionality, but unfortunately it looks like our DBA hasn't installed any of that. What can I do as an alternative to update that table?
As for what I've tried, I created two XML lists and separated each column of the DB into a temporary table so now I have two temporary tables, one for each excel column, but now I'm reading that combining two tables without a common identifier is really bad practice so I'm back at square one.
You can do that easily using SSIS. You can use excel source, Lookup transformation or Merge Join and OLE DB destination.

Excel database values to SQL Server and different tables

I got an Excel file with data which I want to import into a database in Microsoft SQL Server 2008 Express edition.
I do this with right click on a database -> task -> import data.
After this, my data from Excel is loaded in the database in one table.
But I want to seperate the columns from the Excel file into different tables.
So instead of loading all Excel data into one database and table, I want to load the Excel data into one database, but in different tables.
For example: Save column 1,2,3 from Excel in table A, and save column 4,5,6 from Excel in table B.
Anyone that knows how to do this?
I followed the suggestion of #bendataclear:
"Personally I would just import into a temporary table then write INSERT INTO X SELECT queries to move in the correct columns."

How can I join Excel column and SQL View?

I have an Excel spreadsheet, with one worksheet, with one column, containing key values I want to use to lookup data in a SQL Server view.
I can import the view data just fine using ADO or ODBC, but cannot figure out how to have the "Microsoft Query" tool add both the Excel Worksheet and the SQL View in a single query, so that I can join the data. I had also hoped VLOOKUP might lookup external data, but did not find anything,
I have looked for hours and am stumped. Certainly this can be done somehow where I can use a key in an Excel file to fetch a single related SQL table row back into Excel? I'm a hard core C# developer but seem to regularly struggle with Excel...
I would import the excel data into a staging table in your SQL Server database.
Of course you can use ADO to get the excel data into SQL Server.
Then you can join the view with your staging table.
hope this helps.