SELECT
tab.[Name] [Table],
scol.[Name] [Column]
FROM
sysobjects so INNER JOIN (
SELECT [Name],[ID]
FROM sysobjects
WHERE XType = 'U'
) tab
ON so.[Parent_Obj] = tab.[ID] INNER JOIN sysconstraints sc
ON so.[ID] = sc.Constid INNER JOIN syscolumns scol
ON sc.[ColID] = scol.[ColID]
AND tab.[ID] = scol.[ID]
ORDER BY
tab.[Name]
No comments:
Post a Comment