两个主键有可能吗 [英] is there any posiblity for two primary key

查看:87
本文介绍了两个主键有可能吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在SQL2005中创建了一个带有两个主键字段的表,当时我提议要建立一个表,但发生错误,表中的两个主键是否有可能?

i create one table with two primary key fields in SQL2005, whn i proposed to build the table a error is occured, is there any posiblity for two primary key in a table?

推荐答案

编号

一个表必须只有一个主键.

您可以根据需要拥有任意数量的辅助键,但是只有一个主键.
No.

A table must have one, and only one, primary key.

You can have as many secondary keys as you need, but only the single primary.


您只能有一个主键.如果要使用两个不同的列,可以查看复合/复合键 [
You can only have one Primary Key. If you want to use two different columns, you can have a look at Composite/Compound Key[^].


这篇关于两个主键有可能吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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