Lets suppose i have a table A with 4 columns and I've created a view for the same table which consists of all 4 columns. Now i want to write a script/stored procedure which should update the view code whenever new column is added to Table A in a same physical order.
For Example: Table A has following columns
'Name','Age','Gender','Address'
Supposed view code is:
Select Name,Age,Gender,Address from Table A
Now i add an additional column PhoneNumber on Table A. When i run script/Stored Procedure this new column should automatically be added to the query as follows:
Desired view code generated after i run script should be like this:
Select Name,Age,Gender,Address,PhoneNumber from Table A