04-16-2009, 03:00 AM
How to add remote servers
The following can be applied only if all DBS1 logins exist in DBS2. For logins which do not exist in DBS2, the RPC will fail.
If we need to execute RPC from server DBS1 to DBS2 and vice-versa then:
Isql -Uuser -SDBS1
sp_addserver DBS2
sp_addremotelogin DBS2
If passwords are different:
sp_remoteoption DBS2, NULL, NULL, trusted, true
Isql -Uuser -SDBS2
sp_addserver DBS1
sp_addremotelogin DBS1
sp_remoteoption DBS1, NULL, NULL, trusted, true
How to add remote servers for proxy tables
Isql -Uuser -SDBS1
sp_addserver DBS2
If passwords are different:
sp_addexternlogin DBS2,, ,
For safe permissions (only select, since by default it has permissions on proxy tables, databases):
1. Create a read_only_role on target server
2. We create a remote login with the role created as default
3. We grant this role to all required objects.
4. We create a local login having the same login name and password.
5. sp_adduser this login to all databases
6. Check with: "select * from table..."
The following can be applied only if all DBS1 logins exist in DBS2. For logins which do not exist in DBS2, the RPC will fail.
If we need to execute RPC from server DBS1 to DBS2 and vice-versa then:
Isql -Uuser -SDBS1
sp_addserver DBS2
sp_addremotelogin DBS2
If passwords are different:
sp_remoteoption DBS2, NULL, NULL, trusted, true
Isql -Uuser -SDBS2
sp_addserver DBS1
sp_addremotelogin DBS1
sp_remoteoption DBS1, NULL, NULL, trusted, true
How to add remote servers for proxy tables
Isql -Uuser -SDBS1
sp_addserver DBS2
If passwords are different:
sp_addexternlogin DBS2,
For safe permissions (only select, since by default it has permissions on proxy tables, databases):
1. Create a read_only_role on target server
2. We create a remote login with the role created as default
3. We grant this role to all required objects.
4. We create a local login having the same login name and password.
5. sp_adduser this login to all databases
6. Check with: "select * from table..."