Kanishka Mittal
Kanishka Mittal

Reputation: 1

Connection setting between two SQL server to access a different database

I have a question. In SQL server, we can access a table or view in a different database by using the dot notation in the table name, so I believe that in SQL server, if we say just 'tablename' it will refer to the table name in the current active DB, but if we say 'DBname'.'Tablename' you can access the table in a different DB on the same server, and if you say 'serverName'.'DBName'.'tableName' we can access a table in a remote DB whose DBName is defined in a connection setting. I believe we can define a connection setting between two SQL server to access a different database. So, instead of copying the data from one DB to other and duplicate the same, it might be better to simply define a view.

Can anyone please help me if we can do so and how?

Upvotes: 0

Views: 181

Answers (1)

RickyRam
RickyRam

Reputation: 181

Using Linked Server you can access two different servers. use the below link to add the linked server. http://sqlserverplanet.com/dba/how-to-add-a-linked-server

Upvotes: 1

Related Questions