Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Linking 2 DB in same server, different credentials

Author  Topic 

elodea
Starting Member

5 Posts

Posted - 2015-02-16 : 02:57:23
Hi,

I need to join table from 2 database that is reside in same server but both of it use different credentials. Can it be linked together just like linking 2 servers?


Thanks.

waterduck
Aged Yak Warrior

982 Posts

Posted - 2015-02-16 : 03:24:01
what you mean different credentials? do you mean different table schema?
normally it should looks like

[Server].[Database].[Table Schema/Or maybe what you mean credential].[Table Name]
Go to Top of Page

elodea
Starting Member

5 Posts

Posted - 2015-02-16 : 04:35:48
by different credentials i mean when i want to access DB A, i have to use login id : A , password : A and to access DB B, have to use login id : B , password : B


i tried to add the [Server].[Database].[Table Schema].[Table Name] into my query and execute it but this below error appears:

The server principal "xxxx" is not able to access the database "xxxx" under the current security context.
Go to Top of Page
   

- Advertisement -