添加外键约束失败。引用的表“employee”中缺少约束“branch-ibfk-1”的列“emp_id”。

Kayamineni 2023-08-08 17:34:48

 

显示:Faile to add the foreign key constraint.Missing column `emp_id` for constraint `branch-ibfk-1`in the referenced table `employee`.

为什么报错!新手求解,跪求大神能解答一下!

...全文
502 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
sky_2004 2023-08-10
  • 打赏
  • 举报
回复

朋友,细心点。
你 employee 中的主键字段是 emp_ip,建立约束时当然找不到 employee.emp_id 了……

22,299

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧