- Data Analysis and Business Modeling with Excel 2013
- David Rojas
- 509字
- 2021-07-09 21:35:22
Reading multiple tables from MSSQL
In this section, you will learn how to read multiple tables. In practice, the data that you will need will span multiple tables and is usually not found in a single table. We will import the following tables:
Users: This table holds information about all of the home owners who want to rent their homes. Data, such as their name, address, phone number, and registration date, will be found in this table.
PmtHistory: This table captures the data after a user applies to a rental property. It includes information, such as the date the application was submitted and the ID number of the property.
Rateplan: This table contains information on how much it costs the owner of the rental property to process an application.
- We already know from the Reading a table from MSSQL – the Microsoft SQL Server database section how to import a single table, and we will repeat a lot of these steps but with a few differences. Make sure that you close Excel and open a new workbook. Select the DATA tab, click on the From Other Sources button, and select the From SQL Server option, as shown in Figure 2.1 of the Reading a table from MSSQL – the Microsoft SQL Server database section.
- Type the name of your server and click on the Next button, as shown in Figure 2.3 of the Reading a table from MSSQL – the Microsoft SQL Server database section. If you do not know the name of your server, refer to the Reading a table from MSSQL – the Microsoft SQL Server database section for more information.
- In the Data Connection Wizard, make sure that you select the Connect to a specific table and the Enable selection of multiple tables options.
Figure 2.7
- Now, select the database that holds the tables named users, pmthistory, and rateplan by using the drop-down menu. In this example, the database is called BizIntel, and we select this option.
Figure 2.8
After selecting the database, you will see the users, pmthistory, and rateplan tables appear in the middle of the dialog box. Do not worry about the fourth table that shows up, which is named data. This is just an additional table that we can import into Excel if we choose to do so.
- Select the three tables named users, pmthistory, and rateplan, as shown in the following screenshot. This action tells Excel that you want to import these specific tables. You have the option of choosing one or more tables in this step.
Figure 2.9
- You will now see the Import Data dialog box with the PivotTable Report option selected by default. Select the Table option and click on the OK button, as shown in the following screenshot:
Figure 2.10
After you click on the OK button, each table will be placed in a separate sheet. The sheets 2, 3, and 4 will contain the data in the tables named users, pmthistory, and rateplan. That's it! You have just completed the Reading multiple tables from MSSQL section.
- C# Programming Cookbook
- Java從入門到精通(第5版)
- Functional Programming in JavaScript
- Building Minecraft Server Modifications
- 深入淺出Serverless:技術原理與應用實踐
- Solr Cookbook(Third Edition)
- INSTANT Silverlight 5 Animation
- MyBatis 3源碼深度解析
- 青少年學Python(第2冊)
- Scrapy網絡爬蟲實戰
- Redmine Cookbook
- 數字媒體技術概論
- 零基礎學SQL(升級版)
- SAS編程演義
- Elasticsearch搜索引擎構建入門與實戰