sybase数据库如何给表添加主键和外键?

2024-12-04 03:48:41
推荐回答(2个)
回答1:

create table tablename(
id number PRIMARY KEY,
name varchar2(25) REFERENCES tablename2.column
)

回答2:

alter table SOD_DET
add constraint PK_SOD_DET primary key (SOD_COMP, SOD_NBR, SOD_LINE)
using index
tablespace OLS_D
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
);