Question: I am working on an application that we will be using to maintain our database dictionary (description of each column in each table) and would like to build a "Refresh" function that can go to the database and get the updated column list/names.

What I'm having issues with is when a column is renamed/moved, I would like to track if there is way to update the database with the new details. I tried using the `Column_ID` from `syscolumns`, but this changes when the column is moved so seems to be an arbitrary number.

Is there any unique ID that SQL Server generates for a column that doesn't change?

My alternative is to add the new column and mark the old one as removed.

Thanks

Answer: 
Why don't you store the description in the column's description property. Then when the column is updated the developer would be responsible for updating this.

I wrote a web font-end to this over 10 years ago.... I could send you the code if you want? Looked like:

[![enter image description here](https://i.stack.imgur.com/310Qx.png)](https://i.stack.imgur.com/310Qx.png)
You can try this... its a composite of two queries:

This will get you the list of coumns inside a table:

```
SELECT c.object_id, OBJECT_NAME(c.object_id) AS OBJECT_NAME
    ,c.NAME AS COLUMN_NAME
    ,t.NAME AS DATA_TYPE
    ,c.max_length AS MAX_LENGTH
FROM sys.all_columns c
INNER JOIN sys.types t ON t.system_type_id = c.system_type_id
WHERE object_name(c.object_id) = 'TableName'

```

You can generate a HashCode of the column name and combine it with `object_id`... which should be unique unless the column name changed

Hope this will help.