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
 General SQL Server Forums
 New to SQL Server Programming
 Connecting to multiple databases

Author  Topic 

rmg1
Constraint Violating Yak Guru

256 Posts

Posted - 2011-11-18 : 05:41:45
Hi all

I need to be able to connect to two separate databases at the same time.
I can do it in two separate sessions of SQL management studio but I can only access the tables/views from the first one I connect to.

Anyone know of a way round this?

sathiesh2005
Yak Posting Veteran

85 Posts

Posted - 2011-11-18 : 05:46:36
you can use linked servers to connect multiple database in single session

@Sathiesh
Go to Top of Page

rmg1
Constraint Violating Yak Guru

256 Posts

Posted - 2011-11-18 : 06:03:19
The databases are on two separate servers.
Does that cause any problems?
Go to Top of Page

sathiesh2005
Yak Posting Veteran

85 Posts

Posted - 2011-11-18 : 06:16:29
create a linked server from server1 to server2. then you can access both the servers from server1

http://msdn.microsoft.com/en-us/library/aa560998.aspx
http://www.databasejournal.com/features/mssql/article.php/3691721/Setting-up-a-Linked-Server-for-a-Remote-SQL-Server-Instance.htm
or search in google for linked servers in sql server


@Sathiesh
Go to Top of Page

sathiesh2005
Yak Posting Veteran

85 Posts

Posted - 2011-11-18 : 06:17:23
It will not cause any problem in both the servers.

@Sathiesh
Go to Top of Page

jassi.singh
Posting Yak Master

122 Posts

Posted - 2011-11-22 : 05:20:27
check this

http://msdn.microsoft.com/en-us/library/ms188279.aspx
Go to Top of Page
   

- Advertisement -