Dealing With RAISERROR

  • Hi All,

    In SQL for error handling we use RAISERROR function.

    we can also raise the custom Error Like

    DECALRE @strErroMsg VARCHAR(100)

    SET @strErroMsg = = 'Test Error '

    RAISERROR( '%s master not found.', 16, 1, @strErroMsg )

    I tried to use "%d" instead of "%s", also tried to put "%s %s" for passing 2 parameters. but its throwing an Error.

    Can anyone explain me why i can't use any other character ?

  • Hi

    typo in your code I think

    DECLARE @strErroMsg VARCHAR(100)

    SET @strErroMsg = 'Test Error '

    RAISERROR( '%s master not found.', 16, 1, @strErroMsg )

    Allen

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply