• @@error will have the right error code if selected immediately after raiserror command

    raiserror('oh no, another error!', 16,1)

    select @@error

    Thanks

    Igor Micev,My blog: www.igormicev.com