Monday, August 4, 2014

Query to find Computed columns

Use below query to find all computed columns in a database:

SELECT O.NAME AS [Table], C.NAME AS [Column], T.TEXT AS [formula]
FROM SysColumns AS C, SysObjects O, SysComments T
WHERE C.ID = O.ID AND O.ID = T.ID AND C.ColID = T.Number AND Iscomputed = 1 AND O.type = 'U'

No comments:

Post a Comment