SQL Server equivalent to Oracle's CREATE OR REPLACE VIEW

后端 未结 9 1786
猫巷女王i
猫巷女王i 2020-12-02 10:24

In Oracle, I can re-create a view with a single statement, as shown here:

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


        
9条回答
  •  青春惊慌失措
    2020-12-02 11:05

    You can use ALTER to update a view, but this is different than the Oracle command since it only works if the view already exists. Probably better off with DaveK's answer since that will always work.

提交回复
热议问题