PDA

View Full Version : Triggers and Log Files (SQL Server)



melissa820
May 24th, 2006, 08:34 PM
I have this trigger that occurs whenever a row is updated.

My question is, if the raiserror is reached, does it post to a log file?

Thanks in advance!



CREATE TRIGGER res_Update
ON Resort
FOR UPDATE
AS
DECLARE @RNstars int, @RNstars2 int
SELECT @RNstars = inserted.resNumStars, @RNstars2 = deleted.resNumStars
FROM Inserted, Deleted
WHERE deleted.resID = inserted.resID
If @RNstars < @RNstars2
BEGIN
RAISERROR(‘unable to reduce rating’,16,1)
ROLLBACK TRANSACTION
END