1. <legend id='Yvc0V'><style id='Yvc0V'><dir id='Yvc0V'><q id='Yvc0V'></q></dir></style></legend>
  2. <tfoot id='Yvc0V'></tfoot>

      <i id='Yvc0V'><tr id='Yvc0V'><dt id='Yvc0V'><q id='Yvc0V'><span id='Yvc0V'><b id='Yvc0V'><form id='Yvc0V'><ins id='Yvc0V'></ins><ul id='Yvc0V'></ul><sub id='Yvc0V'></sub></form><legend id='Yvc0V'></legend><bdo id='Yvc0V'><pre id='Yvc0V'><center id='Yvc0V'></center></pre></bdo></b><th id='Yvc0V'></th></span></q></dt></tr></i><div id='Yvc0V'><tfoot id='Yvc0V'></tfoot><dl id='Yvc0V'><fieldset id='Yvc0V'></fieldset></dl></div>
      • <bdo id='Yvc0V'></bdo><ul id='Yvc0V'></ul>
    1. <small id='Yvc0V'></small><noframes id='Yvc0V'>

      无法在视图“View_Table_Name"上创建索引,因为该视图未绑定架构

      Cannot create index on view #39;View_Table_Name#39; because the view is not schema bound(无法在视图“View_Table_Name上创建索引,因为该视图未绑定架构)

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

            <tbody id='iekRB'></tbody>

          1. <tfoot id='iekRB'></tfoot>

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

                <bdo id='iekRB'></bdo><ul id='iekRB'></ul>
              • <legend id='iekRB'><style id='iekRB'><dir id='iekRB'><q id='iekRB'></q></dir></style></legend>
              • 本文介绍了无法在视图“View_Table_Name"上创建索引,因为该视图未绑定架构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我在存储过程(SQL-Server)中使用视图.为了提高性能,我尝试创建该视图的 INDEX.

                I am using Views in my stored Procedure(SQL-Server). For Improving Performance, I have tried to created INDEX of that View.

                SET ANSI_NULLS ON
                GO
                SET QUOTED_IDENTIFIER ON
                GO
                ALTER VIEW VW_Table_Name
                AS
                SELECT Col1,Col2,Col3 FROM Table_Name 
                GO
                CREATE UNIQUE CLUSTERED INDEX Index_Name ON [VW_Table_Name](Col1)
                GO
                

                这里我收到了类似的错误

                Here I am getting the Error like

                消息 1939,级别 16,状态 1,第 1 行无法在视图VW_FML"上创建索引,因为该视图未绑定架构.

                Msg 1939, Level 16, State 1, Line 1 Cannot create index on view 'VW_FML' because the view is not schema bound.

                我们可以在 SQL Server 中为视图创建索引吗?

                Can we created Index for View in SQL Server ?

                推荐答案

                索引视图有很多限制:没有子查询、没有联合、没有外连接等.参见 这篇文章 了解更多详情.但对于您的情况,您只需要创建具有架构绑定的视图.

                There are a number of restrictions on indexed views: no subqueries, no unions, no outer joins, etc. See this article for more details. But for your case, you simply need to create the view with schema binding.

                CREATE VIEW VW_Table_Name WITH SCHEMABINDING
                AS
                SELECT Col1,Col2,Col3 FROM Table_Name 
                GO
                

                这篇关于无法在视图“View_Table_Name"上创建索引,因为该视图未绑定架构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                相关文档推荐

                Maximum stored procedure, function, trigger, or view nesting level exceeded (limit 32)(超出最大存储过程、函数、触发器或视图嵌套级别(限制 32))
                How to debug stored procedure in VS 2015?(如何在 VS 2015 中调试存储过程?)
                How to find a text inside SQL Server procedures / triggers?(如何在 SQL Server 程序/触发器中查找文本?)
                SQL Server stored procedure return code oddity(SQL Server 存储过程返回码奇怪)
                Conditional SQL ORDER BY ASC/DESC for alpha columns(alpha 列的条件 SQL ORDER BY ASC/DESC)
                Export stored procedure result set to Excel in SSMS(在SSMS中将存储过程结果集导出到Excel)

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

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

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

                            <tbody id='XJbaf'></tbody>
                        • <legend id='XJbaf'><style id='XJbaf'><dir id='XJbaf'><q id='XJbaf'></q></dir></style></legend>
                          <tfoot id='XJbaf'></tfoot>