display data from 2 tables in excel from sql server - excel

I want to display 2 table data from SQL Server to Excel file. Each table has 2 columns.
I know that we can do this using Data tab. But what I could understand is we need to create 2 connections for the 2 tables.
Can we use a single connection and using this connection display the data from 2 tables?
Thanks in advance

Nope, you cannot connect two tables with one connection.
There is workaround to join tables in SQL query or use Union and index each table with column with name of the table.
Or if you do not want to use queries, try Microsoft Query from Excel, here is link to see how to use it.
https://help.acctivate.com/articles/3727/
Still I would suggest to do two connections.

Related

Delta Load on BSEG table into AZure using SAP table conenctor

We are using SAP ABAP oracle environment.I'm trying to implement Change Data capture for the SAP BSEG table in Azure datafactory using SAP table connector. In SAP table connector, I don't see an option to pass any join conditions. Based on what fields we can capture the CDC on BSEG table.
BSEG is a cluster table.
It dates back to R2 days on Mainframes.
See Se11 BSEG --> Menu option Database Object --> Database utility.
Run Check.
It will most likely say NOT ON DATABASE.
If you want to access the data via views see one of the numerous index tables.
BSxx description Accounting: Secondary Index for xxxxx
These so called Index tables are separate tables that behave like indexes
on bseg but arent true indexes as cluster tables can not have indexes.
The index tables are real tables you can access with joins/views.
The document number can be used read BSEG later should that still be necessary.
You may find FI_DOCUMENT_READ and BKPF useful too.
In theory the Index tables should be enough.
From the SAP Table connector help:
Currently SAP Table connector only supports one single table with the default function module. To get the joined data of multiple tables, you can leverage the customRfcReadTableFunctionModule property in the SAP Table connector following steps below
...
So no, table joins are not supported by default, you need to write in SAP backend a custom FM with the predefined interface. The interface to do is described in the help.
If you use Azure Data factory to Azure Data Explorer doing big tables like BSEG can be done with a work around.
Although BSEG is a cluster of tables in SAP, from the SAP Connector point of view it is a table with rows and columns which can be partitioned.
Here is an example for MSEG which is similar.
MSEG_Partitioned
Kind Regards
Gauchet

merge a query to a connection in Excel

I am working with a Pivot table in Excel that uses a connection to a SAS db. I want to join in a few of my own tables to the connection to add to the pivot table, and have added them into different tabs in the Excel workbook and then use the Get Data feature to import them into the data model. However, it won't let me merge any of the new tables with the original connection. Is there a way to do this?
There is no way for me to alter the SAS db as its owned by a different team in my organization.

Importing data from excel to multiple tables in Oracle DB

I have an excel sheet with a single workbook with data in it. The data is around 1000 rows and 50 columns. I need to import these data to an Oracle DB every week. Here comes the problem, the columns in the sheet belongs to different tables with some columns go in multiple tables. I use SQL Developer V.18.1.0.095. Thanks in advance for the help.
Note: I created a temp table and copied all data to it, then wrote the query to push each column to its respective tables. But, I feel its complex and think it won't work. Is there any better way.
PL/SQL Developer has special tool for tasks like this, calls ODBC Importer (Menu 'Tools'-> ODBC Importer).
For use it you have to set Excel File in USER / System DSN field and your domain user and password, and push Connect after.
After connection developer will ask you path of excel file, and after you can create table in heiborhood tab for your dataset.
Or, you can use sql loader. Ask google how to. It's easy.

Using an Access Query in a pivot table in Excel

I have a ton of records across 5 different tables in Access that I'm consolidating in one query.
I want to now be able to connect that query to excel and pivot the data that is in the query. Is that possible? If so, is there a way to do it without added VBA? I was thinking of slowly exporting the consolidated data into a new table in access but with over 7 million records, it'll take some time. Anyway to save myself that headache? When I connect the DB to excel, the only tables that are coming up are the 5 tables and not the query.

EXCEL: This file has more than xxxx records

I am trying to open a file that i exported from TOAD which has 1.4 million records. It has 4 columns.
I tried opening the file in notepad++, deleting half records there and copying them into other file and saving them. But when i open the 2 files in excel, all the columns are combined as one column.
Could someone give me a solution on how to divide the 1.4million records excel file into 2 files without messing up the columns or data.
If you are married to Excel, skip Toad completely and bring the data in directly with MS Query.
If this isn't SQL Server, you will need to set up an ODBC connection, and from there you can bind the query to the spreadsheet as follows:
From the "Data" tab, select "From Other Sources"
Pick SQL Server if it's SQL Server or MS Query if it's anything else
Skip all of the menus and paste in your SQL once you get to MS Query
Close MS Query, and your live query (and its results) will be dynamically linked to an Excel table (aka ListObject)
The great thing about this is when you want to refresh the query, right-click and refresh. Done.
Better still, you can set up the ODBC connection for your boss and he can do it himself.
Oh, and if you want this split into two datasets, change your SQL to pull the first half and the second half and have them each in a different worksheet. How you do this depends on your DBMS, which I'd encourage you to tag in your question.

Resources