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.
Author |
Topic |
allan8964
Posting Yak Master
249 Posts |
Posted - 2012-03-15 : 13:07:32
|
Hi there,I openened 2 conenctions in 1 management studio object explore window, But I can only access the database in one connection. Can I switch to any one I want to? Scenario as folowing:In server1 connect to server2 and I can see 2 connections in object explore window. Now I can work on a table1 in db1 in server1 with use db1; goBut when I try to work on table2 in db2 in server2 with use db2; go I always got error: Database 'db2' does nto exist. Make sure ...Some help plz .... Thanks in advance. |
|
X002548
Not Just a Number
15586 Posts |
|
allan8964
Posting Yak Master
249 Posts |
Posted - 2012-03-15 : 13:52:50
|
server1 is local and server2 is in same domain and we can access via RDP. |
|
|
jeffw8713
Aged Yak Warrior
819 Posts |
Posted - 2012-03-15 : 16:45:19
|
Open a new query window and connect to the other instance. You can have multiple query windows open - each connected to a different server (or same server).Sounds like you want to be able to query 2 separate instances of SQL Server in the same query window. That is possible, but it gets a bit more complex. If that is what you want to do - then I suggest you read up on SQLCMD mode in SSMS which will allow you to change your connection as needed in a single editor window.Or, you can look at setting up linked servers - if you need to join the data from both instances. |
|
|
alishaali
Starting Member
8 Posts |
Posted - 2012-03-28 : 04:22:56
|
Register the both servers and write query to fetch data from that particular server2 .. refer usage of linked server , how it works |
|
|
|
|
|