<bdo id='vPAxa'></bdo><ul id='vPAxa'></ul>

    <legend id='vPAxa'><style id='vPAxa'><dir id='vPAxa'><q id='vPAxa'></q></dir></style></legend>
    <i id='vPAxa'><tr id='vPAxa'><dt id='vPAxa'><q id='vPAxa'><span id='vPAxa'><b id='vPAxa'><form id='vPAxa'><ins id='vPAxa'></ins><ul id='vPAxa'></ul><sub id='vPAxa'></sub></form><legend id='vPAxa'></legend><bdo id='vPAxa'><pre id='vPAxa'><center id='vPAxa'></center></pre></bdo></b><th id='vPAxa'></th></span></q></dt></tr></i><div id='vPAxa'><tfoot id='vPAxa'></tfoot><dl id='vPAxa'><fieldset id='vPAxa'></fieldset></dl></div>
    1. <tfoot id='vPAxa'></tfoot>

        <small id='vPAxa'></small><noframes id='vPAxa'>

      1. 如何使 CREATE OR REPLACE VIEW 在 SQL Server 中工作?

        How to make CREATE OR REPLACE VIEW work in SQL Server?(如何使 CREATE OR REPLACE VIEW 在 SQL Server 中工作?)

        <i id='k1qt8'><tr id='k1qt8'><dt id='k1qt8'><q id='k1qt8'><span id='k1qt8'><b id='k1qt8'><form id='k1qt8'><ins id='k1qt8'></ins><ul id='k1qt8'></ul><sub id='k1qt8'></sub></form><legend id='k1qt8'></legend><bdo id='k1qt8'><pre id='k1qt8'><center id='k1qt8'></center></pre></bdo></b><th id='k1qt8'></th></span></q></dt></tr></i><div id='k1qt8'><tfoot id='k1qt8'></tfoot><dl id='k1qt8'><fieldset id='k1qt8'></fieldset></dl></div>

            <small id='k1qt8'></small><noframes id='k1qt8'>

              <tfoot id='k1qt8'></tfoot>
              <legend id='k1qt8'><style id='k1qt8'><dir id='k1qt8'><q id='k1qt8'></q></dir></style></legend>
                  <tbody id='k1qt8'></tbody>
                  <bdo id='k1qt8'></bdo><ul id='k1qt8'></ul>

                • 本文介绍了如何使 CREATE OR REPLACE VIEW 在 SQL Server 中工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  CREATE OR REPLACE VIEW 在 SQL Server 中似乎不起作用.那么如何将 CREATE OR REPLACE VIEW 移植到 SQL Server 上?

                  CREATE OR REPLACE VIEW doesn't seem to work in SQL Server. So how do I port CREATE OR REPLACE VIEW to work on SQL Server?

                  这就是我想要做的:

                  CREATE OR REPLACE VIEW data_VVVV AS 
                  SELECT 
                      VCV.xxxx,
                          VCV.yyyy AS yyyy,
                          VCV.zzzz AS zzzz
                  FROM 
                  TABLE_A
                  ;
                  

                  有什么想法吗?

                  推荐答案

                  虽然这个问题被标记为重复,但它仍然受到关注.@JaKXz 提供的答案是正确的,应该是公认的答案.

                  您需要检查视图是否存在.然后根据结果执行 CREATE VIEWALTER VIEW.

                  You'll need to check for the existence of the view. Then do a CREATE VIEW or ALTER VIEW depending on the result.

                  IF OBJECT_ID('dbo.data_VVVV') IS NULL
                  BEGIN
                      CREATE VIEW dbo.data_VVVV
                      AS
                      SELECT VCV.xxxx, VCV.yyyy AS yyyy, VCV.zzzz AS zzzz FROM TABLE_A VCV
                  END
                  ELSE
                      ALTER VIEW dbo.data_VVVV
                      AS
                      SELECT VCV.xxxx, VCV.yyyy AS yyyy, VCV.zzzz AS zzzz FROM TABLE_A VCV
                  BEGIN
                  END
                  

                  这篇关于如何使 CREATE OR REPLACE VIEW 在 SQL Server 中工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  SQL query to group by day(按天分组的 SQL 查询)
                  What does SQL clause quot;GROUP BY 1quot; mean?(SQL 子句“GROUP BY 1是什么意思?意思是?)
                  MySQL groupwise MAX() returns unexpected results(MySQL groupwise MAX() 返回意外结果)
                  MySQL SELECT most frequent by group(MySQL SELECT 按组最频繁)
                  Include missing months in Group By query(在 Group By 查询中包含缺失的月份)
                  Why Mysql#39;s Group By and Oracle#39;s Group by behaviours are different(为什么 Mysql 的 Group By 和 Oracle 的 Group by 行为不同)
                      <tfoot id='oy2TO'></tfoot>

                      <legend id='oy2TO'><style id='oy2TO'><dir id='oy2TO'><q id='oy2TO'></q></dir></style></legend>
                          <tbody id='oy2TO'></tbody>
                        <i id='oy2TO'><tr id='oy2TO'><dt id='oy2TO'><q id='oy2TO'><span id='oy2TO'><b id='oy2TO'><form id='oy2TO'><ins id='oy2TO'></ins><ul id='oy2TO'></ul><sub id='oy2TO'></sub></form><legend id='oy2TO'></legend><bdo id='oy2TO'><pre id='oy2TO'><center id='oy2TO'></center></pre></bdo></b><th id='oy2TO'></th></span></q></dt></tr></i><div id='oy2TO'><tfoot id='oy2TO'></tfoot><dl id='oy2TO'><fieldset id='oy2TO'></fieldset></dl></div>

                          <small id='oy2TO'></small><noframes id='oy2TO'>

                          • <bdo id='oy2TO'></bdo><ul id='oy2TO'></ul>