June 12, 2011 at 11:19 pm
hello all.
I need to access to description of view columns.I know to access description of table columns.please give me one script that show description of columns of views.
June 13, 2011 at 12:52 am
use sp_columns <viewname>
June 14, 2011 at 3:14 pm
elham_azizi_62 (6/12/2011)
hello all.I need to access to description of view columns.I know to access description of table columns.please give me one script that show description of columns of views.
SELECT
COL.*
FROM INFORMATION_SCHEMA.TABLES AS TAB
INNER JOIN INFORMATION_SCHEMA.COLUMNS AS COL
ON COL.TABLE_CATALOG = TAB.TABLE_CATALOG
AND COL.TABLE_SCHEMA = TAB.TABLE_SCHEMA
AND COL.TABLE_NAME = TAB.TABLE_NAME
WHERE
TAB.TABLE_TYPE = 'VIEW'
ORDER BY
COL.TABLE_CATALOG
,COL.TABLE_SCHEMA
,COL.TABLE_NAME
,COL.ORDINAL_POSITION
June 14, 2011 at 6:33 pm
😀
Best Regards,
Ashkan
June 14, 2011 at 6:38 pm
SELECT v1.name
FROM sys.columns v1
INNER JOIN sys.views v2 on V1.OBJECT_ID = V2.OBJECT_ID
and V2.NAME = 'VIEWNAME'
Best Regards,
Ashkan
June 14, 2011 at 10:55 pm
elham_azizi_62 (6/12/2011)
hello all.I need to access to description of view columns.I know to access description of table columns.please give me one script that show description of columns of views.
Gosh... they're so close to each other. Did you even try?
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply