• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
小香猪 工作室~~
————含泪播种的人一定能含笑收获 !!!

asp.net、 C#、 Sql Server、 html+css、 wpf、 wcf and so on

兢兢业业学技术 踏踏实实诚做人……
博客园    首页    新随笔    联系   管理    订阅  订阅
创建表两个主键外键~~~

create table A

(

  id int primary key not null,

  name nvarchar(20) not null,

  address  varchar(50) not null

)

这个是主表(设置了一个主键)

create table B

(

  id int not null foreign key references A(id) on delete cascade,

  orderid int not null,

  class nvarchar(20) not null,

  primary key(id,orderid)

)

主要是分清主表和次表的关系啦……

徐燕平
posted on 2010-11-20 15:22  xyp0605  阅读(250)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3