Hi, I want to konw if there is a way to write a query connecting to two different servers. The reason for this requirement is I had to compare the columns and its constraints that exists in similar tables & databases but in two different servers. Im sorry if it sounds crazy.
Hi Bharath, Have you ever tried using Linked server??? if not just try using it as it can work for your requirement. If not kindly revert back with the actual requirement, so that we can drill down further and help you out. Thanks Sethu
Configure linked server and query syscolumns and syscontraints to compare columns and constraints. you can write a query something like this Select *From [linkedservername or IP].DatabaseName.sys.Columns Refer http://msdn2.microsoft.com/en-us/library/aa172738(SQL.80).aspx Madhu
The above link was very useful. Im just learning about linked servers. For Example I have two Servers A and B. After linking server A with B and if you execute "sp_linkedservers" in server A, it shows the list of servers linked with it. But if you execute the same in server B none are returned. Does this mean I had to link server B to A too?
If you want to access Server A from Server B, then you should configure Linkedserver in Server B also. Madhu