Linked Server in SQL Server 2005

To Query from other database
Connect to the database
Go to Database-->Server Objects-->Linked Servers
Right Click For New Linked Server
On the new Linked Server Window U get three pages to Select

  1. General
  2. Security
  3. Server Options
Under the General Page U specify the linked server name
Select provider
Specify DataSource(IP for Other Server where Ur Db is)
Catalog and Prduct Name would be the username for that servers database userid.
Now GoTo Security Page
Check this radio button ‘Be made using this security context’.
It will ask for username and password for the remote database.
Now click on OK.
U have successfully created New linked Server.
Moving Forward
Create view for the data to be pulled from other server write query
create view v_viewexample as viewname
select * from linkedserver.username.dbo.tablename
Thats it U r Done..

0 comments:

Post a Comment