(Component Integration Services only) Creates a proxy table, then retrieves and stores metadata from a remote table and places the data into the proxy table. Allows you to map the proxy table to a table, view, or procedure at a remote location.
The preferred method of creating proxy tables is the create proxy_table command, which eliminates the need to define the column definitions.
create existing table table_name (column_list) [on segment_name] [[external {table | procedure | file | connection_type}] at pathname [column delimiter "string"]]
non_transactional – is a separate connection is used to execute the RPC.
transactional – is the existing connection is used to execute the RPC.
The default behavior is transactional.
server_name (required) – is the name of the server that contains the remote object.
dbname (optional) – is the name of the database managed by the remote server that contains this object.
owner (optional) – is the name of the remote server user that owns the remote object.
object (required) – is the name of the remote table, view, or procedure.
create existing table authors ( au_id id, au_lname varchar (40) NOT NULL, au_fname varchar (20) NOT NULL, phone char (12), address varchar (40) NULL, city varchar (20) NULL, state char (2) NULL, zip char (5) NULL, contract bit ) at "nhserver.pubs2.dbo.authors"
create existing table syb_columns ( id int, number smallint, colid tinyint, status tinyint, type tinyint, length tinyint, offset smallint, usertype smallint, cdefault int, domain int, name varchar (30), printfmt varchar (255) NULL, prec tinyint NULL, scale tinyint NULL ) at "remote1.master.dbo.columns"
create existing table blurbs ( author_id id not null, copy text not null ) at "SERVER_A.db1.joe.blurbs"
create existing table rpc1 ( column_1 int, column_2 int ) external procedure at "SERVER_A.db1.joe.p1"
create existing table does not create a new table unless the remote object is a file. Instead, CIS checks the table mapping to confirm that the information in column_list matches the remote table, verifies the existence of the underlying object, and retrieves and stores metadata about the remote table.
If the host data file or remote server object does not exist, the command is rejected with an error message.
The nature of the existing object is determined. For host data files, this requires determining file organization and record format. For remote server objects, this requires determining whether the object is a table, a view, or an RPC.
For remote server objects (other than RPCs), column attributes obtained for the table or view are compared with those defined in the column_list.
Index information from the host data file or remote server table is extracted and used to create rows for the sysindexes system table. This defines indexes and keys in the SAP ASE server terms and enables the query optimizer to consider any indexes that might exist on this table.
The on segment_name clause is processed locally and is not passed to a remote server.
After successfully defining an existing table, issue update statistics for the table. This allows the query optimizer to make intelligent choices regarding index selection and join order.
CIS allows you to create a proxy table with a column defined as NOT NULL even though the remote column is defined as NULL. It displays a warning to notify you of the mismatch.
The location information provided by the at keyword is the same information that is provided by sp_addobjectdef. The information is stored in the sysattributes table.
CIS inserts or updates a record in the systabstats catalog for each index of the remote table. Since detailed structural statistics are irrelevant for remote indexes, only a minimum number of columns are set in the systabstats record—id, indid, and rowcnt.
External files cannot be of datatypes text, image, or Java ADTs.
ANSI SQL – Compliance level: Transact-SQL extension.
create existing table permission defaults to the table owner and is not transferable.