Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

How to create list of a View's column names and source

$
0
0

Using SQL 2005, 2008, and 2012

How to create list of a View's column names and source. For the following example would like to @Print something like the following.  Does anyone already have some code to do this? I realize there are probably some gotchas, but the views that I am looking at to use this follows the code snippet pattern below.

DBACCT.[Account Number]
dbo.ConvertDate(DBACDT). [Boarding Date]
DBXES.DBXES

CREATE VIEW [dbo].[v_ods_DBAL]   
AS  
SELECT    DBACCT AS [Account Number], dbo.ConvertDate(DBACDT) AS [Boarding Date], DBXES
FROM dbo.ods_DBAL


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>