Reputation: 1086
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.
Upvotes: 1
Views: 257
Reputation: 101
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
Upvotes: 0
Reputation: 2835
The answer is no. Oracle maintains a unique id of a column (Progress database does this as well), but SQL Server does not.
Upvotes: 1