The following example defines the remote Adaptive Server table authors, starting with the server definition:
Define a server named SYBASE. Its server class is ASEnterprise, and its name in the interfaces file is SYBASE:
exec sp_addserver SYBASE, ASEnterprise, SYBASE
Define a remote login alias. This step is optional if the username and password are the same on both servers. User “sa” is known to remote server SYBASE as user “sa,” password “timothy”:
exec sp_addexternlogin SYBASE, sa, sa, timothy
Define the remote authors table:
create existing table authors ( au_id varchar(11) not null, au_lname varchar(40) not null, au_fname varchar(20) not null, phone char(12) not null, address varchar(40) null, city varchar(20) null, state char(2) null, country varchar(12) null, postalcode char(10) null ) EXTERNAL TABLE at "SYBASE.pubs2.dbo.authors"
Update statistics on tables to ensure reasonable choices by the query optimizer:
update statistics authors
Execute a query to test the configuration:
select * from authors where au_lname = 'Carson'