• Take a good look at the URL in my previous post about the meaning and position of the parameters. Here is some sample code to help you:

    declare @exists int

    set @exists = 0

    if@exists = 0

    begin

    /*

    RAISERROR ( { msg_id | msg_str | @local_variable }

    { ,severity ,state }

    [ ,argument [ ,...n ] ] )

    [ WITH option [ ,...n ] ]

    */

    -- specify ad-hoc message with severity 10:

    raiserror ('The system cannot find the file specified.', 10, 1)

    -- creating, using and removing a custom defined message:

    exec sp_addmessage @msgnum = 50004, @severity = 10, @msgtext = N'The system cannot find file ''%s'' specified.';

    raiserror (50004,10,1,'FILE')

    exec sp_dropmessage @msgnum = 50004;

    end

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **