<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 中工作?

        时间:2024-04-15

        <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 中工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:显示 oracle 数据库上的所有视图 下一篇:MySQL 视图 - 何时使用 &amp;什么时候不

                  相关文章

                    <tfoot id='oy2TO'></tfoot>

                    <legend id='oy2TO'><style id='oy2TO'><dir id='oy2TO'><q id='oy2TO'></q></dir></style></legend>
                      <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>