What is the Oracle's CREATE OR REPLACE VIEW equivalent for SQL Server?

+1 vote
254 views
asked May 22, 2017 by Hitesh Garg (355 points)  

In Oracle, a view can be recreated using a single statement i.e. CREATE OR REPLACE VIEW , for ex:

CREATE OR REPLACE VIEW MY_VIEW AS
SELECT SOME_FIELD
FROM SOME_TABLE
WHERE SOME_CONDITIONS

As per this syntax, it either creates or replaces the existing view with the mention fields, tables, and conditions.

What is the equivalent in SQL Server that can do the same thing i.e. checking of existing view and DROP it before executing the create command?

Please log in or register to answer this question.

...