I want to update the existing view without dropping it, can you just provide me the syntax how to do it..?
Existing view:
CREATE VIEW V1 AS SELECT EMP_ID,NAME FROM EMP_TABLE
I want to update V1 as:
SELECT EMP_ID,NAME, SALARY WHERE SALARY>10000
It's as simple as:
ALTER VIEW V1 AS
SELECT EMP_ID,NAME, SALARY WHERE SALARY > 10000;
If you forget this in the future, you can always right click on the view in SQL Server Management Studio and select 'Modify' this will give you the current query, with the correct syntax for altering it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With