Geeks With Blogs

News


Rodney Vinyard - .NET & SQL Developer When all is said and done, more will be said than done

find columns and tables in a view

 

SELECT  vObj.name AS vName, vObj.id AS vID, vObj.xtype AS vType,

          dep.depid, dep.depnumber, tObj.name AS tName, col.colid,

          col.name AS cName

FROM         sysobjects vObj LEFT OUTER JOIN

             sysdepends dep ON vObj.id = dep.id LEFT OUTER JOIN

             sysobjects tObj ON dep.depid = tObj.id LEFT OUTER JOIN

             syscolumns col ON dep.depnumber = col.colid

                   AND tObj.id = col.id

WHERE   vObj.xtype = 'V' And vObj.category = 0

and   vObj.name = 'vw1_inv_item_det'

ORDER BY vObj.name, tObj.name, col.name

 

Posted on Tuesday, April 29, 2008 4:54 AM SQL Server 2005 Tricks , SQL Server 2000 Tricks | Back to top


Comments on this post: find columns and tables in a view

# re: find columns and tables in a view
Requesting Gravatar...
flower girl dresses, tuxedos, and other special occasion apparel. Site includes a bridal
designer wedding dress
Left by G on Mar 29, 2010 12:34 AM

# re: find columns and tables in a view
Requesting Gravatar...
flower girl dresses, tuxedos, and other special occasion apparel. Site includes a bridal
wedding dresses
designer wedding dress
Left by G on Mar 29, 2010 12:35 AM

Your comment:
 (will show your gravatar)


Copyright © Rodney Vinyard | Powered by: GeeksWithBlogs.net