27,579
社区成员
发帖
与我相关
我的任务
分享
create table orders
(o_id int not null,
orderNo int not null
constraint pk_orders primary key clustered(o_id) --> 指定约束名pk_orders, 推荐格式: pk_表名
)
-- 可以用rename 修改一下,不过没什么必要
EXEC sp_rename 'TABLE_NAME.FK_OLD_NAME', 'FK_NEW_NAME', 'INDEX'
CREATE TABLE Orders (
[o_id][int] NOT NULL CONSTRAINT [PK_Orders] PRIMARY KEY CLUSTERED ,
[OrderID]INT NOT NULL
)
GO