The following example illustrates the steps necessary to define the remote Adaptive Server table, authors, starting with the server definition:
Define a server named SYBASE. Its server class is sql_server, and its name in the interfaces file is SYBASE:
exec sp_addserver SYBASE, sql_server, SYBASE
Define a remote login alias. This step is optional. 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 id 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 ) at "SYBASE.pubs2.dbo.authors", "table"
Update statistics in 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'