Forum Discussion
HW31
5 years agoNew 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.
- 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
2 Replies
- darentengmfs
Post Prodigy
- GilbertQ
Super User
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