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