>Im just wondering if there is an eaiser way to accomplish this?
not really. SQL Server's error handling is very primitive.
I'm hopeing that things will change with Yukon.
The only suggestion that I have is to not do the second insert if the first fails. I see no reason to cause SQL Server to do work that will just be reversed. you could try something like this:
DECLARE @result int
INSERT INTO students ...
SET @result = @@ERROR
IF @result != 0 GOTO __cleanup
IF @logmove = 1
BEGIN
INSERT INTO movelog ...
SET @result = @@ERROR
END
__cleanup:
IF @result != 0
BEGIN
ROLLBACK TRANSACTION
RAISERROR('Unable to move student out.', 16, 1)
END
ELSE COMMIT TRANSACTION
RETURN @result