Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

How to retrieve the table names from a View using SMO Expand / Collapse
Posted Tuesday, June 28, 2011 2:26 PM


Group: General Forum Members
Last Login: Thursday, July 7, 2011 12:00 PM
Points: 11, Visits: 27

I am writing a User Interface to view all the SMO.View objects and display the components involved in it. One of the issues I am having is to retrieve all the tables involved in an existing View. I can see all the columns involved. But the Column.Parent only points to the View itself. I need the names of the tables for each column including their alias if any. I can see this information in the View.TextBody. I can also see the column information by calling View.EnumColumns(). But I can't find the table information anywhere. I am sure this information is stored somewhere in the view or elsewhere on the database. Can someone help me with this please? I really appreciate it.

Post #1133241
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse