Tuesday, 23 April 2013

Transanction for sql in store procedure

begin try
        begin transaction
    Update SubMenu_Master set Menu_Id=@Menu_Id,Sub_Menu_Name=@Sub_Menu_Name,
    Sub_Menu_Description=@Sub_Menu_Description,Sub_Menu_Shortcut=@Sub_Menu_Shortcut
   where Sub_Menu_Id=@Sub_Menu_Id;

Update Menu_List_Details set Menu_Id=@Menu_Id where Sub_Menu_Id=@Sub_Menu_Id;

    SET @message='Update Successfully';
    commit transaction
    end try
    begin catch
        rollback transaction
    end catch

No comments:

Post a Comment