-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Microsoft Power BI Cookbook
By :

Microsoft SQL Server is a popular relational database management system (RDBMS). Database software products such as SQL Server have the primary function of storing and retrieving data as requested by other software applications, which may run either on the same computer or another computer across a network.
SQL Server often serves as the source of data for Power BI reports. In addition, some of the recipes and examples in this book center around accessing the Microsoft AdventureWorks sample database hosted on SQL Server. This recipe will help you get this environment created so that you can follow along in those recipes.
To prepare for this recipe, download the Developer edition of SQL Server from the following link: https://www.microsoft.com/en-us/sql-server/sql-server-downloads. The downloaded file should be named SQL2022-SSEI-Dev.exe
.
Also, download SQL Server Management Studio, which is used to view and configure Microsoft SQL Server. Download the SSMS-Setup-ENU.exe
file from this link: https://aka.ms/ssmsfullsetup.
First, we will install the Developer Edition of SQL Server, and then, SQL Server Management Studio.
To install SQL Server, use the following steps:
SQL2022-SSEI-Dev.exe
.C:\Program Files\Microsoft SQL Server
.Figure 1.13: Successful installation of SQL Server
SSMS-Setup-ENU.exe
file.SSMS-Setup-ENU.exe
file again.Microsoft SQL Server as well as SQL Server Management Studio are now installed and ready for use.
The AdventureWorks database is a sample database provided by Microsoft that is often used for demonstration and learning purposes. The database is designed to showcase the capabilities and features of Microsoft SQL Server. The AdventureWorks database has evolved over different versions of SQL Server, with the latest version at the time of this book’s publication being 2022.
The database represents a fictional company called AdventureWorks Cycles, a manufacturing company that produces and sells bicycles and related products. The AdventureWorks database includes various tables that model different aspects of the company’s operations, such as customers, sales, products, employees, and more.
Each version of the AdventureWorks database comes in three different backup (.bak
) files:
For our purposes, we will use the data warehouse (DW) version of the AdventureWorks database.
To install and configure the AdventureWorks DW database, follow these steps:
.bak
) file from GitHub using this link: https://bit.ly/3QTnCXI. The downloaded file is called AdventureWorksDW2022.bak
.AdventureWorksDW2022.bak
file from the Downloads directory to the C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\Backup
directory.AdventureWorksDW2022.bak
file and click the OK button. Click the OK button in the Select backup devices window, and finally, click the OK button on the General page. Use Figure 1.14 for guidance on executing these steps in sequence.Figure 1.14: Restoring the AdventureWorksDW2022 backup file
Figure 1.15: Relocate all files to folder
The AdventureWorksDW2022
database is now available in the Object Explorer under Databases, as shown in Figure 1.16:
Figure 1.16: Restored AdventureWorksDW2022 database
We will use this database in future recipes within this book to demonstrate some of the amazing capabilities of Power BI.
Microsoft SQL Server runs as a set of services on your computer. These services can be seen using the Windows Services application and include the following:
Multiple instances of SQL Server can run on the same computer. The default is to create an instance called MSSQLSERVER.
We can connect to this service using SQL Server Management Studio. To do this, start typing SQL Server Management Studio in the Windows search bar, and then open the application when it appears, as shown in Figure 1.17:
Figure 1.17: Running SQL Server Management Studio
On the Connect to Server window, ensure that Database Engine is selected for Server type, that the name of your local computer appears for Server name, and that the Authentication is set to Windows Authentication. Click the Connect button to connect to the local instance of SQL Server, as shown in Figure 1.18:
Figure 1.18: SQL Server Management Studio
For additional information on the topics covered in this recipe, refer to the following links: