google@digitallsd.com (JMack) wrote in message news:<472b479f.0402170642.37a57121@posting.google. com>...[color=blue]
> Okay, so I have a problem and I would be REALLY grateful for any
> assistance anyone can offer because I have found little or no help on
> the web anywhere.
>
> I want to access and do joins between tables in two different SQL db's
> on the same server. Heres what Im dealing with.
>
> In one database resides all of my security features for our clients,
> where it decides who can login, etc etc....
>
> In another database, I need to cross reference with a few fields in my
> security db.
>
> See the issue Im running into here is that because the way the people
> have their databases set up for different products, I would normally
> have to put these tables with security features in every database...
> which is horrible, because every time I do an update I would have to
> do it in 12 different places. Thats not efficient at all.
>
> So I thought if I had one central DB, where all security features are
> controlled from, that would be perfect... now the issue is cross
> referencing and doing joins with other tables that ARENT in the same
> db....
>
>
> have I lost you yet?
>
> I appreciate all of your help!
>
> THANKS!![/color]
As a general answer to your question, you can write code like this:
select *
from dbo.ThisTable t1
join ThatDatabase.dbo.ThatTable t2
on t1.KeyColumn = t2.KeyColumn
Assuming you have SQL2000 (you didn't mention the version), you should
review the "Using Ownership Chains" topic in Books Online for
information about cross-database ownership chains (and there is an
article in the current SQL Server Magazine also).
Simon