create existing table

Description

Creates a new proxy table representing an existing object in a remote server.

Syntax

 create existing table [database.[owner].]table_name (column_name datatype
    [default {constant_expression | user | null}]
     {[{identity | null | not null}]
     | [[constraint constraint_name]
         {{unique | primary key}
          [clustered | nonclustered]
          [with {fillfactor |max_rows_per_page}= x]
         [on segment_name]
         | references [[database.]owner.]ref_table
            [(ref_column)]
         | check (search_condition)}]}...
 
 | [constraint constraint_name]
     {{unique | primary key} 
         [clustered | nonclustered]
         (column_name [{, column_name}...])
          [with {fillfactor |max_rows_per_page}= x]
          [on segment_name]
     | foreign key (column_name [{, column_name}...])
         references [[database.]owner.]ref_table
            [(ref_column [{, ref_column}...])]
      | check (search_condition)}
 
 [{, {next_column | next_constraint}}...])
 
 [with max_rows_per_page = x] [on segment_name]
[external {table | procedure}]
[at “pathname”]

Usage

Usage


Server Class ASEnterprise

Table 3-4: Adaptive Server datatype conversions for create existing table

Remote Adaptive Server Datatype

Allowable Adaptive Server Datatypes

binary(n)

image, binary(n), and varbinary(n); if not image, the length must match

bit

bit, decimal, float, int, money, numeric, real, smallint, smallmoney, and tinyint

char(n)

text, nchar( n), nvarchar( n), char( n), varchar(n), unichar, univarchar; if not text, the length must match

datetime

datetime and smalldatetime

decimal(p, s)

bit, decimal, float, int, money, numeric, real, smallint, smallmoney, and tinyint

float

bit, decimal, float, int, money, numeric, real, smallint, smallmoney, and tinyint

image

image

int

bit, decimal, float, int, money, numeric, real, smallint, smallmoney, and tinyint

money

bit, decimal, float, int, money, numeric, real, smallint, smallmoney, and tinyint

nchar(n)

text, nchar( n), nvarchar( n), char( n), varchar( n); if not text, the length must match

numeric(p, s)

bit, decimal, float, int, money, numeric, real, smallint, smallmoney, and tinyint

nvarchar(n)

text, nchar( n), nvarchar( n), char( n), varchar(n), unichar, univarchar; if not text, the length must match

real

bit, decimal, float, int, money, numeric, real, smallint, smallmoney, and tinyint

smalldatetime

datetime and smalldatetime

smallint

bit, decimal, float, int, money, numeric, real, smallint, smallmoney, and tinyint

smallmoney

bit, decimal, float, int, money, numeric, real, smallint, smallmoney, and tinyint

text

text

timestamp

timestamp

tinyint

bit, decimal, float, int, money, numeric, real, smallint, smallmoney, and tinyint

unichar

char, varchar, unichar, univarchar, text, datetime, and smalldatetime

univarchar

char, varchar, unichar, univarchar, text, datetime, and smalldatetime

varbinary(n)

image, binary(n), and varbinary(n); if not image, the length must match

varchar(n)

text, nchar( n), nvarchar( n), char( n), varchar(n) unichar, univarchar; if not text, the length must match


Server Class ASAnywhere

Table 3-5: Adaptive Server Anywhere datatype conversions for create existing table

Remote Adaptive Server Datatype

Allowable Adaptive Server Datatypes

binary(n)

image, binary(n), and varbinary( n); if not image, the length must match

bit

bit, decimal, float, int, money, numeric, real, smallint, smallmoney, and tinyint

char(n)

text, nchar(n), nvarchar(n), char(n), varchar(n), unichar, univarchar; if not text, the length must match

datetime

datetime and smalldatetime

decimal(p, s)

bit, decimal, float, int, money, numeric, real, smallint, smallmoney, and tinyint

float

bit, decimal, float, int, money, numeric, real, smallint, smallmoney, and tinyint

image

image

int

bit, decimal, float, int, money, numeric, real, smallint, smallmoney, and tinyint

money

bit, decimal, float, int, money, numeric, real, smallint, smallmoney, and tinyint

nchar(n)

text, nchar(n), nvarchar(n), char(n), varchar(n), unichar, univarchar; if not text, the length must match

numeric(p, s)

bit, decimal, float, int, money, numeric, real, smallint, smallmoney, and tinyint

nvarchar(n)

text, nchar(n), nvarchar(n), char(n), varchar(n), unichar, univarchar; if not text, the length must match

real

bit, decimal, float, int, money, numeric, real, smallint, smallmoney, and tinyint

smalldatetime

datetime and smalldatetime

smallint

bit, decimal, float, int, money, numeric, real, smallint, smallmoney, and tinyint

smallmoney

bit, decimal, float, int, money, numeric, real, smallint, smallmoney, and tinyint

text

text

timestamp

timestamp

tinyint

bit, decimal, float, int, money, numeric, real, smallint, smallmoney, and tinyint

varbinary(n)

image, binary(n), and varbinary(n), unichar, univarchar; if not image, the length must match

varchar(n)

text, nchar(n), nvarchar(n), char(n), varchar(n), unichar, univarchar; if not text, the length must match


Server Class ASIQ


Server Class sql_server


Server Class direct_connect


Server Class db2

See also

See Also

create existing table in the Adaptive Server Reference Manual.