PDA

View Full Version : خطای The transaction ended in the trigger. The batch has been aborted.



kebriya
شنبه 26 دی 1394, 14:02 عصر
سلام دوستان من برای اینکه رکورد تکراری در جدولم درج نشه تریگر زیرو نوشتم ولی موقع اجرا خطای
The transaction ended in the trigger. The batch has been aborted.
رو بهم میده

تریگرم هم اینطوری نوشتم


after INSERT
AS
if(select count(*) from FactorList,inserted where
FactorList.Fac_tarikh=inserted.Fac_tarikh and
FactorList.Fac_sharh=inserted.Fac_sharh and
FactorList.Fac_moshtari=inserted.Fac_moshtari
)<>1
rollback transaction

kebriya
یک شنبه 27 دی 1394, 08:04 صبح
برای حل مشکل بالا کافیه دستورتونو توی try بزارید همین :لبخند: