Unique id of a column
Does each column of a tab开发者_运维百科le 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.
The answer is no. Oracle maintains a unique id of a column (Progress database does this as well), but SQL Server does not.
If you are trying to get a column which table A and B both contains, you could use
SELECT A.col or B.col
However if you are trying to get the unique id from the master control, it seems not really possible for SQL server
精彩评论