PDA

View Full Version : Msg 266, Level 16, State 2,



seeker
دوشنبه 30 شهریور 1388, 08:29 صبح
سلام. یه transaction ساده دارم که سه تا رکورد رو از سه تا جدول دیلیت میکنه. اما مسیج266 میده. ماجرا چیه؟

USE [dpc]
GO
/****** Object: StoredProcedure [dbo].[sp_deleteFactor] Script Date: 09/21/2009 09:16:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
SET XACT_ABORT ON
GO
ALTER PROCEDURE [dbo].[sp_deleteFactor]
@id int
AS

BEGIN transaction
begin
delete from detail where prnt=@id
delete from factorKhadamat where factor=@id
delete from factor where id=@id

return 1
end
if @@ERROR<>0
begin
rollback transaction
return 0
end
commit transaction