Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deconstructing a view.

Status
Not open for further replies.

denimined

Programmer
Sep 29, 2004
54
CA
I need a way to deconstruct a view. That is, for a given column in a view, find the reference table / column that was used to construct the view. I know that
Select * from information_schema.view_column_usage
will give me the source tables and columns for the entire view, but it does not give me the specific reference for any given column. Any suggestions?

(MS SQL 2000)

Thanks.



 
YOu could open the view in design mode or script it.

Questions about posting. See faq183-874
 
No, I am attempting to write a search and replace function to a grid that displays rows from a view. The views have been designed to be non-editable, but under specific circumstances, the user will be able to replace data - thus the requirement to get back to the original table / column.
 
Why use a view at all then? Just use the actual tables as your data source.

Or script the view to get the tables you need and write specific inserts or update statments for the things the users can change.

Questions about posting. See faq183-874
 
The viewer is a generic viewer and works for tables and views. This is all wrapped up in a VB application. The tables in the view are joined by proper relational design. (i.e. primary keys / foreign keys) I could build a lookup structure to hold the view information but this will get convoluted very quickly as some of the views are based on unions of multiple views.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top