为什么在sql server 2005中使用xml时必须设置ARITHABORT?我试着研究为什么我要设置这个,但找不到告诉我原因的答案.只需要设置它.
这是我在取出SET ARITHABORT ON时获得的特定错误消息:
PARAMETER ERROR:INSERT LIST可能无法分配 - INSERT失败,因为以下SET选项的设置不正确:'ARITHABORT'.验证SET选项是否正确,以便与计算列和/或查询通知和/或xml数据类型方法的索引视图和/或索引一起使用.
我的存储过程在一个环境中使用odbc从asp.net调用很好.然后,当我将它移动到另一个时,我必须在存储过程的开头添加SET ARITHABORT ON.我在下面列出了存储过程的相关部分.以及调用它的代码.
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, …Run Code Online (Sandbox Code Playgroud) 我有这个函数写入我的日志文件.它默默地失败了.因为在此函数中没有引发错误,它只是无法创建或写入文件.我正在写信给你%TEMP%\myappname.log.它也失败了%USERPROFILE%\Desktop\myappname.log.服务器是Windows Server 2008 R2 Standard.我用其他程序写入应用程序文件夹时遇到了这种情况,因此转移到写入%TEMP%目录并解决了这个问题.但是这个系统甚至不会让我写到%TEMP%目录.是的我尝试以管理员身份运行,但没有帮助.在这种情况下,%TEMP%解析ExpandEnvironmentStrings为,C:\Users\sa\AppData\Local\Temp\2
所以g_strLogPath是C:\Users\sa\AppData\Local\Temp\2\myappname.log.
Public Function LogMessage(ByVal strInput As String, Optional ByVal blnDate As Boolean = False) As Boolean
Dim intFileNumber As Integer
On Error GoTo ErrorHandler
If g_lngLogLevel <> 1 Then
Exit Function
End If
If Len(g_strLogPath) = 0 Then
SetLogPath
End If
If blnDate Then
strInput = Format(Now, cstrLogDateFormat) & " : " & strInput
End If
intFileNumber = FreeFile
Open g_strLogPath For …Run Code Online (Sandbox Code Playgroud)