I have created a view that is based on another view and a table. I want to add new column of type varchar. I did like below, But getting syntax error? I am new to SQL, So,could not understand
ALTER VIEW [dbo].[MyView]
ADD New_Col varchar(10) null
GO
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