当前位置:当前位置:首页 >域名 >sql server外键建立的写法 正文

sql server外键建立的写法

[域名] 时间:2025-11-05 06:36:46 来源:益强IT技术网 作者:应用开发 点击:90次
sql server外键建立的写法
复制CREATE TABLE [dbo].[Varrily]   (   [ID] [bigint] NOT NULL ,键建   [Name] [char] (10) NULL ,   [Address] [char] (480) NULL ,   [Introduction] [ntext] NULL    )    CREATE TABLE [dbo].[MyTable]   (   [ID] [bigint] IDENTITY (1, 1) NOT NULL ,   [AuthorID] [bigint] NOT NULL ,   [Title] [char] (40) NULL ,   [Date_of_Created] [datetime] NULL   )    被引用的键必须***,香港云服务器可以设置为主键或者添加***约束。IT技术网写法键建   alter table dbo.Varrily add constraint pk_id primary key (ID)   alter table dbo.Varrily add constraint un_id unique (ID)   alter table dbo.MyTable add constraint fk_AuthorID foreign key (AuthorID) references dbo.Varrily([ID])   1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.企商汇

(责任编辑:IT科技)

    相关内容
    精彩推荐
    热门点击
    友情链接