How to add new column in existing View in SQL-Server 2014 using Alter

浪尽此生 提交于 2019-11-29 10:09:23

you have to write the entire view again and just add or omit what you want to change

for example your view is now :

create view myView as
  select field1
  from table1

and now you want to add a field called New_Col than you write this :

alter view myView as
  select field1,
         New_Col
  from table1

You can't alter a view like a table. You have to script the view as Alter, and then alter the select statement that generates the view.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!