我们可以在sql server 2000的表中有多个外键吗 [英] Can we have multiple foreign keys in a table at sql server 2000

查看:213
本文介绍了我们可以在sql server 2000的表中有多个外键吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要创建一个用于插入标记的表,因此我需要输入学生标记的使用者ID和主题名称,这些Studentid和Subjectname都来自两个不同的表,因此我可以在我的表格中同时使用这些Studentid和Subjectname列用于插入标记的新表并赋予它们两个外键约束,我正在将asp.net 3.5框架与sql server 2000数据库一起使用.

I am in need to create a table for inserting marks , so i am in need for studentid and subjectname for entering marks both these studentid and subjectname are from two different tables , so can i use both these studentid and subjectname columns in my new table for inserting marks and give them both foreignkey constraint , I am using asp.net 3.5 framework with sql server 2000 database.

推荐答案

单字答案是肯定的.

照片:
* photo_id(PK)
*文件路径

评论:
* comment_id(PK)
*身体

comment_to_post
* comment_id(PK)-> FK到comment.comment_id
* post_id(PK)-> FK到post.post_id

阅读此 http://msdn.microsoft.com/en-us/library/ms179610.aspx
Single word answer is Yes.

photo:
* photo_id (PK)
* filepath

comment:
* comment_id (PK)
* body

comment_to_post
* comment_id (PK) -> FK to comment.comment_id
* post_id (PK) -> FK to post.post_id

Read this http://msdn.microsoft.com/en-us/library/ms179610.aspx


这篇关于我们可以在sql server 2000的表中有多个外键吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆