SELECT 1 FROM Staff WHERE DivisionID = @DivisionId IF (@@ROWCOUNT > 0) -- Data found BEGIN RAISERROR('Cannot delete Division, it has staff',16,1) END DELETE Division WHERE @DivisionId = DivisionId
Post a Comment
No comments:
Post a Comment