• <small id='0mtie'></small><noframes id='0mtie'>

      <bdo id='0mtie'></bdo><ul id='0mtie'></ul>

    <legend id='0mtie'><style id='0mtie'><dir id='0mtie'><q id='0mtie'></q></dir></style></legend>
      <tfoot id='0mtie'></tfoot>

      1. <i id='0mtie'><tr id='0mtie'><dt id='0mtie'><q id='0mtie'><span id='0mtie'><b id='0mtie'><form id='0mtie'><ins id='0mtie'></ins><ul id='0mtie'></ul><sub id='0mtie'></sub></form><legend id='0mtie'></legend><bdo id='0mtie'><pre id='0mtie'><center id='0mtie'></center></pre></bdo></b><th id='0mtie'></th></span></q></dt></tr></i><div id='0mtie'><tfoot id='0mtie'></tfoot><dl id='0mtie'><fieldset id='0mtie'></fieldset></dl></div>
      2. 为什么在 sql server 2005 中使用 xml 时必须将 ARITH

        时间:2023-06-07

          <tbody id='Fd3w7'></tbody>

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

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

                  本文介绍了为什么在 sql server 2005 中使用 xml 时必须将 ARITHABORT 设置为 ON?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  为什么在 sql server 2005 中使用 xml 时必须将 ARITHABORT 设置为 ON?我试着研究为什么我必须设置这个,但找不到告诉我原因的答案.只是它需要设置.

                  Why do I have to SET ARITHABORT ON when using xml in sql server 2005? I tried researching why I have to set this but couldn't find an answer that told me why. Only that it needs to be set.

                  这是我取出 SET ARITHABORT ON 行时得到的具体错误信息:

                  Here is the specific error message I get when I take out the SET ARITHABORT ON line:

                  参数错误:无法解析插入列表 - 插入失败因为以下 SET 选项的设置不正确:'ARITHABORT'.验证 SET 选项是否正确用于索引计算列和/或查询通知上的视图和/或索引和/或 xml 数据类型方法.

                  PARAMETER ERROR: INSERT LIST COULD NOT BE PARSED - INSERT failed because the following SET options have incorrect settings: 'ARITHABORT'. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or query notifications and/or xml data type methods.

                  我的存储过程在一种环境中使用 odbc 从 asp.net 调用运行良好.然后当我将它移到另一个时,我不得不在存储过程的开头添加 SET ARITHABORT ON.我在下面包含了存储过程的相关部分.以及调用它的代码.

                  My stored procedure worked fine called from asp.net using odbc in one environment. Then when I moved it to another, I had to add SET ARITHABORT ON in the beginning of the stored procedure. I include the relevant sections of the stored procedure below. And the code that is calling it.

                  CREATE PROCEDURE [dbo].[myproc]
                     @ruserid             varchar(8),
                     @folder_list         xml,
                     @insert_list         xml
                  AS
                  
                  SET NOCOUNT ON
                  SET ARITHABORT ON
                  
                  DECLARE @rindex integer
                  DECLARE @errormsg nvarchar(4000)
                  DECLARE @folder_cnt integer
                  DECLARE @insert_cnt integer
                  
                  
                  SET @rindex = -1
                  
                  -- temp table to hold inserts
                  CREATE TABLE #insert_list (rowidx integer IDENTITY(1,1), insertdesc varchar(96) COLLATE database_default, insertfolder integer)
                  
                  -- temp table to hold folders
                  CREATE TABLE #folder_list (rowidx integer IDENTITY(1,1), folderdesc varchar(144) COLLATE database_default, insertfolder integer)
                  
                  -- insert inserts to make sure data is compatible in type
                  BEGIN TRY
                     INSERT INTO #insert_list (insertdesc, insertfolder)
                     SELECT insert_list.listitem.value('@insertdesc', 'varchar(96)'), insert_list.listitem.value('@insertfolder', 'integer')
                     FROM @insert_list.nodes('/Root/Insert') AS insert_list(listitem)
                  END TRY
                  BEGIN CATCH
                     SET @errormsg = N'PARAMETER ERROR: INSERT LIST COULD NOT BE PARSED - ' + ERROR_MESSAGE()
                     RAISERROR(@errormsg, 16, 1)
                     RETURN
                  END CATCH
                  
                  -- insert folders to make sure data is compatible in type
                  BEGIN TRY
                     INSERT INTO #folder_list (insertfolder, folderdesc)
                     SELECT folder_list.listitem.value('@insertfolder', 'integer'), folder_list.listitem.value('@folderdesc', 'varchar(144)')
                     FROM @folder_list.nodes('/Root/Folder') AS folder_list(listitem)
                  END TRY
                  BEGIN CATCH
                     SET @errormsg = N'PARAMETER ERROR: FOLDER LIST COULD NOT BE PARSED - ' + ERROR_MESSAGE()
                     RAISERROR(@errormsg, 16, 1)
                     RETURN
                  END CATCH
                  
                  -- insert rows
                  BEGIN TRANSACTION
                  
                  BEGIN TRY
                  
                  INSERT INTO my_folder_request (ruserid)
                  VALUES ( @ruserid )
                  
                  SET @rindex = SCOPE_IDENTITY()
                  
                  INSERT INTO my_insert_request (rindex, insertdesc, insertfolder)
                  SELECT @rindex, #insert_list.insertdesc, #insert_list.insertfolder
                  FROM #insert_list
                  ORDER BY #insert_list.rowidx
                  
                  INSERT INTO my_folder_desc (rindex, insertfolder, folderdesc)
                  SELECT @rindex, #folder_list.insertfolder, #folder_list.folderdesc
                  FROM #folder_list
                  ORDER BY #folder_list.rowidx
                  
                  END TRY
                  BEGIN CATCH
                     IF @@TRANCOUNT > 0
                        ROLLBACK TRANSACTION
                     SET @errormsg = N'DATA INSERTION FAILED WITH MESSAGE - ' + ERROR_MESSAGE()
                     RAISERROR(@errormsg, 16, 1)
                     RETURN
                  END CATCH
                  
                  IF @@TRANCOUNT > 0
                     COMMIT TRANSACTION
                  
                  -- return result
                  SELECT @rindex AS rindex
                  
                  DROP TABLE #insert_list
                  DROP TABLE #folder_list
                  
                  GO           
                  

                  调用代码

                    ' build odbc command for inserting creation request
                    intRequestIndex = 0
                    cmdAddRequest = New System.Data.Odbc.OdbcCommand
                    cmdAddRequest.CommandType = CommandType.StoredProcedure
                    cmdAddRequest.CommandTimeout = 60
                    cmdAddRequest.CommandText = "{CALL myproc ( ?, ?, ?)}"
                  
                    ' add parameters to odbc command
                    cmdAddRequest.Parameters.Add("@ruserid", OdbcType.VarChar, 8).Value = SafeODBCParamString(m_strUID)
                    cmdAddRequest.Parameters.Add("@folder_list", OdbcType.NText).Value = System.Text.Encoding.Unicode.GetString(strmFolderList.ToArray())
                    cmdAddRequest.Parameters.Add("@insert_list", OdbcType.NText).Value = System.Text.Encoding.Unicode.GetString(strmInsertList.ToArray())
                  
                    ' run odbc command returning info about results
                    cmdAddRequest.Connection = Me.ODBCConnection()
                    Try
                       rdrRequestData = cmdAddRequest.ExecuteReader(CommandBehavior.CloseConnection) 
                  

                  推荐答案

                  我认为网上书籍中的这句话暗示了它:当您在计算列或索引上创建或更改索引时,SET ARITHABORT 必须为 ON意见."所以节点方法必须在内部创建索引视图或其他东西.但这只是一个有根据的猜测.

                  I'm thinking this statement from books online kind of hints at it: "SET ARITHABORT must be ON when you are creating or changing indexes on computed columns or indexed views." So the nodes method must be creating an indexed view internally or something. But this is just an educated guess.

                  这篇关于为什么在 sql server 2005 中使用 xml 时必须将 ARITHABORT 设置为 ON?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何在 SQL Server 的 XQuery 中获取特定的 XML 命名空 下一篇:即使表达式值为空,如何强制执行 xmlforest creat

                  相关文章

                  最新文章

                  <legend id='ViLl6'><style id='ViLl6'><dir id='ViLl6'><q id='ViLl6'></q></dir></style></legend><tfoot id='ViLl6'></tfoot>

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

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