大家好,当我在存储过程代码上更改简单且几乎没有什么东西时,突然出现以下错误,它工作得很好,如果我清除了更新的代码,它又可以正常工作了,所以我不知道是什么原因,这里是错误“当前事务无法提交并且不支持写入日志文件的操作。回滚事务”
提前致谢
ALTER Procedure [dbo].[xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx]
@English Bit = 0 ,
@ID BigInt = NULL Output ,
@Company_ID SmallInt = NULL ,
@Cust_ID NVarChar (20) = NULL ,
@Cust_Cat NVarChar (10) = NULL ,
@Debit_Limit Decimal (18,3) = NULL ,
@From_Date NVarChar (19) = NULL ,
@To_Date NVarChar (19) = NULL ,
@User_ID NVarChar(50) = NULL
As
BEGIN
Create Table #Errors (ErrorNumber int Not Null, ErrorValue nvarchar(300) Collate Arabic_CI_AS Null);
Begin Tran trn_INV_CustDebLim_setupInsert;
Begin Try
Insert Into INV_Cust_Debit_Limit_setup
( Company_ID , Cust_ID , Cust_Cat , Debit_Limit , From_Date , To_Date )
Values
( @Company_ID , @Cust_ID , @Cust_Cat , @Debit_Limit , @From_Date , @To_Date )
set @ID = @@IDENTITY
-- From Here Is New Part --
declare @str nvarchar(50)
IF(@Cust_ID IS NOT NULL)
set @str = 'xxxxxxxxxxxxxxxxxxxxxxxxxxx ' + @Cust_ID
IF(@Cust_Cat IS NOT NULL)
set @str += 'xxxxxxxxxxxxxxxxxxxxxxxxxxxx ' + @Cust_Cat
set @str += ' xxxxx' +@Debit_Limit + ' xxxx xx' +@From_Date
IF(@English = 1)
BEGIN
IF(@Cust_ID IS NOT NULL)
set @str = 'Credit Limit Added On Customer ' + @Cust_ID
IF(@Cust_Cat IS NOT NULL)
set @str += 'Credit Limit Added On Customer Category ' + @Cust_Cat
set @str = ' With Value ' +@Debit_Limit + ' From Date ' +@From_Date
END
exec usp_GLApplicationAudit @Company_ID , NULL , 10 , @User_ID , @str ,@ID ,10, NULL , NULL ,NULL ,NULL,NULL,'SAl'
-- To Here Is New Part --
End Try
Begin Catch
Insert #Errors Values(1002,ERROR_MESSAGE());
Goto Finished;
End Catch
-- Return Error Records
Finished:
-- retrieve Errors and commit/Rollbak Trans.
If (Select count(E.ErrorNumber)
From #Errors E Left Join GVT_Errors G
On E.ErrorNumber = G.Err_Number
Where G.Err_Type=0 ) > 0
Begin
-- The Following are Errors
Select E.ErrorNumber As [Err_No], G.MessageA + ': ' + E.ErrorValue As [Err_Desc], Err_Source, dbo.fn_GetItemDescription('Err_Type',Cast(Err_Type As nvarchar), null, null, null, null, 0) As Err_Type_Desc, Err_Type, SeverityLevel As [Severity], CategoryID
From #Errors E Left Join GVT_Errors G
On E.ErrorNumber = G.Err_Number;
Rollback Tran trn_INV_CustDebLim_setupInsert;
End
Else
Begin
-- The Following Not Errors They are Warnings or Information
Select E.ErrorNumber As [Err_No], G.MessageA + ': ' + E.ErrorValue As [Err_Desc], Err_Source, dbo.fn_GetItemDescription('Err_Type',Cast(Err_Type As nvarchar), null, null, null, null, 0) As Err_Type_Desc, Err_Type, SeverityLevel As [Severity], CategoryID
From #Errors E Left Join GVT_Errors G
On E.ErrorNumber = G.Err_Number;
Commit Tran trn_INV_CustDebLim_setupInsert;
End
DROP Table #Errors;
END