Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cross database query security

Status
Not open for further replies.

kmfna

MIS
Sep 26, 2003
306
0
0
US
Hello all,

I have been looking, but can't find any relevant information about the security of joining tables across databases. I personally can't see an issue at first glance, but one of my colleagues quite condescendingly said there is a security issue and I should "just google it" and wouldn't say any more than that.

Does anyone know of any issues that should be considered? We are running SQL Server 2005.

Thank you all in advance!
-Kevin

- "The truth hurts, maybe not as much as jumping on a bicycle with no seat, but it hurts.
 
Are these databases on the same server?
Does the login you are using have access to both databases?

As long as your account has rights to both databases there won't be any security problems.

For example:

If I have db1 and db2 on ServerA and I need user1 to query db1.tableA and db2.tableA, then I would just add user1 to both databases and write my query like this.

select whatever
from db1.dbo.tableA a
join db2.dbo.tableA b on a.field = b.field

- Paul
- If at first you don't succeed, find out if the loser gets anything.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top