Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
HW31
New Member

Limit access to a single database on a server

When connecting a power bi, i have to connect to the server, and optionally, a dB. This server has several dBs on it and I was wondering is there a way to limit the access of the pbi file to a single server? Surely once connected, you can access all databases.

1 ACCEPTED SOLUTION

Hi there

The first thing is that you would need the permissions to access all the databases.

IF you do have permissions you could access all the databases through a single connection.

For example if your main connection uses a database called: MyFirstDatabase the TSQL Query could be

Select *
from MyFirstDatabase.dbo.table_Name

Now if you wanted to access another database on the same server, where the other database is called "SecondDatabase" you could use the following TSQL Query

Select *
from SecondDatabase.dbo.tableName




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

View solution in original post

2 REPLIES 2
darentengmfs
Post Prodigy
Post Prodigy

@HW31 

 

To do that you have to state which Database you want to use when connecting to the server.

 

darentengmfs_0-1600465649894.png

 

Hi there

The first thing is that you would need the permissions to access all the databases.

IF you do have permissions you could access all the databases through a single connection.

For example if your main connection uses a database called: MyFirstDatabase the TSQL Query could be

Select *
from MyFirstDatabase.dbo.table_Name

Now if you wanted to access another database on the same server, where the other database is called "SecondDatabase" you could use the following TSQL Query

Select *
from SecondDatabase.dbo.tableName




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors