Question : How many parameters can we give in Raiserror method?

Hi,
I have a raiserror statement in my Stored procedure as follows.
begin raiserror(80206,16,1,'this username does not exist') return -1 end
And when I tried to retrieve this error code from sysmessages as follows
select * from sysmessages where error = '80206' , it gave the below record with 5 columns.
80206   16      0       processing error. '%s'   1033

Now when I tried to execute the stored procedure, it is giving
processing error 'this username does not exist' which is correct.
But I also wanted to print the username by giving another parameter @username so the output would be as follows.
processing error 'this username does not exist' John
Could you please tell me if it is possible to include this parameter in the raiserror statement?
Thanks for your help!

Answer : How many parameters can we give in Raiserror method?

EXEC sp_dropmessage  80206

EXEC sp_addmessage
    @msgnum = 80206,
    @severity = 16,
    @msgtext =
        'processing error. ''%s''  %s'

then update stored procedure:
begin raiserror(80206,16,1,'this username does not exist', @username)

See SQL Server 2005 Books Online entry for sp_addmessage
Random Solutions  
 
programming4us programming4us