SELECT col.name, cm.text
FROM syscolumns col
JOIN syscomments cm ON cm.id = col.id AND cm.number = col.colid
WHERE COLUMNPROPERTY ( col.id , col.name, 'IsComputed' ) = 1 AND OBJECT_NAME(col.id) = 'tablename'
Originally Posted by JohnLewis
Can anyone tell me how to find out if a column is a 'formula' or computed column - and what the formula is?
sp_columns @table_name = 'table' gives me most of the stuff I want but it doesn't show what the formula is for any formula columns...