sql server当前事务无法提交,也不支持写入日志文件的操作。回滚交易

时间:2017-03-21 07:21:13

标签: sql sql-server

当前事务无法提交,也无法支持写入日志文件的操作。回滚交易。

请帮我纠正以下问题。

class Program
{
    static void Main(string[] args)
    {
        var res = AlternateCharCases("cat");
        foreach (var r in res)
            Console.WriteLine(r);
        Console.ReadKey();
    }
    public static List<string> AlternateCharCases(string lowercaseWord)
    {
        var result = new List<string>();
        AlternateCharCases(lowercaseWord, lowercaseWord.ToCharArray(), 0, result);
        result = result.Distinct().ToList();
        return result;
    }

    static void AlternateCharCases(string initialWord, char[] word, int startIndex, List<string> result)
    {
        if (startIndex == word.Length)
            result.Add(new string(word));
        else
        {
            if(!Char.IsLetter(initialWord[startIndex]))
            {
                word[startIndex] = initialWord[startIndex];
                AlternateCharCases(initialWord, word, startIndex + 1, result);
            }
            else
            {
                word[startIndex] = initialWord[startIndex];
                AlternateCharCases(initialWord, word, startIndex + 1, result);
                word[startIndex] = Char.ToUpper(initialWord[startIndex]);
                AlternateCharCases(initialWord, word, startIndex + 1, result);
            }
        }

    }

}

1 个答案:

答案 0 :(得分:0)

请在下次完成查询

  begin try
  begin transaction
  declare @Increment as int = 0
print @Increment
set @Increment=@Increment+1
print 'test'
Update table1 Set status='DONE',Processeddatetime=getutcdate() where OAPermID=@POAPermID
and Systemstartdatetime=@pSystemstartdatetime and BatchID=@BatchID
Update table1 Set status='DONE' where Organizationid=@POAPermID and status='pending' and BatchID=@BatchID
  commit transaction
    end try
  begin catch
  declare @xact_status as varchar(30) = cast(xact_state() as varchar(30))
  select error_number() as errornumber, error_line() as errorline, error_message() as errormessage,
         error_procedure() as errorprocedure, error_state() AS errorState, error_severity() as errorseverity,
         @xact_status as exactstatus
  rollback transaction       
  end catch