Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
amsqlguy
Yak Posting Veteran
89 Posts |
Posted - 2010-10-11 : 14:12:45
|
GuysI have two columns in a table (organization) as orgname and type which are getting moved to organization_detail. The organization table is referenced in 200 views for these two columns is there a generic way to change the view definitions to point to the new table for these two columns organization_detailPlease refer to below example for sampleOLD DEFINITIONselect e.id, e.name, o.orgname, o.orgtype, o.estyear, o.locationfrom employee e inner join organization o on e.id = o.empidNEW DEFINITIONselect e.id, e.name, od.orgname, od.orgtype, o.estyear, o.locationfrom employee e inner join organization o on e.id = o.empidinner join organization_detail od on od.orgid = o.idAny suggestions/inputs would help.Thanks |
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2010-10-11 : 14:46:41
|
might be easiest to make a view with the exact name and column names of the original table. that way all the views will just work without modifying them all |
 |
|
amsqlguy
Yak Posting Veteran
89 Posts |
Posted - 2010-10-11 : 14:50:29
|
The columns will be named the exact, but how would you ensure that a new join gets added and table reference in the select list for the columns changes in all 200 views.Thanks |
 |
|
|
|
|