Accessing column descriptions

  • Does anyone know where I can programmatically grab user table column descriptions? I have entered table column descriptions using the 'Design Table' interface in the Enterprise Manager. I tried looking in the syscolumns and syscomments tables thinking they would be there, but they are not. Thank-You...

  • Try sysproperties. An easy way to test is to use EM to design a table and near the bottom enter some text for the description and save. Also whenever you're stuck trying to find something that has to be stored somewhere, consider using Profiler while you do the task in EM - great way to see whats going on!

    Andy

  • Thanks Andy, I will try your sugestions. After some more research i did find that column descriptions is part of the 'extended properties' and i was able to access them using fn_listextendedproperty()

  • Should have thought of that too - functions often encapsulate quite a bit of code, just depends on how many times you're accessing the same table whether it makes sense to use them or a join instead.

    Andy

  • use the Information_Schema views

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply