0
0
Power BIbi_tool~10 mins

SQL Server connection in Power BI - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the server name in the connection string.

Power BI
let Source = Sql.Database([1], "SalesDB")
Drag options to blanks, or click blank then click option'
A"localhost"
B"User"
C"Database"
D"ServerName"
Attempts:
3 left
💡 Hint
Common Mistakes
Using the database name instead of the server name.
Not putting the server name inside quotes.
2fill in blank
medium

Complete the code to specify the database name in the connection string.

Power BI
let Source = Sql.Database("MyServer", [1])
Drag options to blanks, or click blank then click option'
A"Server"
B"UserDB"
C"SalesDB"
D"Connection"
Attempts:
3 left
💡 Hint
Common Mistakes
Using the server name instead of the database name.
Not putting the database name inside quotes.
3fill in blank
hard

Fix the error in the connection code by completing the missing part.

Power BI
let Source = Sql.Database("MyServer", "SalesDB", [1])
Drag options to blanks, or click blank then click option'
A[ConnectionTimeout=30]
B{[ConnectionTimeout=#duration(0,0,30,0)]}
C{ConnectionTimeout=30}
D{[ConnectionTimeout=30]}
Attempts:
3 left
💡 Hint
Common Mistakes
Not using a record (curly braces and square brackets) for options.
Using a plain number instead of a duration for ConnectionTimeout.
4fill in blank
hard

Fill both blanks to set the connection with integrated security and a command timeout.

Power BI
let Source = Sql.Database("MyServer", "SalesDB", [1])
Drag options to blanks, or click blank then click option'
A{[IntegratedSecurity=true, CommandTimeout=#duration(0,0,2,0)]}
B{[CreateNavigationProperties=false, CommandTimeout=#duration(0,0,2,0)]}
C{[IntegratedSecurity=true, CommandTimeout=120]}
D{[TrustedConnection=true, CommandTimeout=#duration(0,0,2,0)]}
Attempts:
3 left
💡 Hint
Common Mistakes
Using plain numbers for CommandTimeout.
Using wrong option names like TrustedConnection.
5fill in blank
hard

Fill all three blanks to create a connection with server, database, and a custom SQL query.

Power BI
let Source = Sql.Database([1], [2], [Query=[3]])
Drag options to blanks, or click blank then click option'
A"MyServer"
B"SalesDB"
C"SELECT * FROM Customers"
D"SELECT * FROM Orders"
Attempts:
3 left
💡 Hint
Common Mistakes
Not putting strings inside quotes.
Using an invalid SQL query.