列的唯一 ID
SQL Server中表的每一列都有唯一的id吗?我查看了 sys.columns 和 column_id ,其中只有列的顺序会随着列的顺序更改而更改。我想知道 SQL Server 是否为每个列维护一个唯一的 id,就像为每个表和其他对象维护一个唯一的 id 一样。如果是这样,我怎样才能得到它?谢谢。
Does each column of a table in SQL Server have a unique id? I've looked into sys.columns and the column_id there is merely the order of the columns which changes if the order of the column is changed. I'd like to know if SQL Server maintains a unique id for each column as it does for each table and other objects. And if it does, how can I get that? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
答案是否定的。 Oracle 维护列的唯一 ID(Progress 数据库也这样做),但 SQL Server 不维护。
The answer is no. Oracle maintains a unique id of a column (Progress database does this as well), but SQL Server does not.
如果你试图获取表A和B都包含的列,你可以使用
但是如果你试图从主控件获取唯一的id,这对于SQL Server来说似乎不太可能
If you are trying to get a column which table A and B both contains, you could use
However if you are trying to get the unique id from the master control, it seems not really possible for SQL server