• I see 2 times your calling RAISERROR 50001

    RAISERROR (50001, -- Message id.

    16, -- Severity,

    1, -- State,

    N'xp_cmdshell call in [dbo].[adminManagePartition_Trace] failed. Purge not complete.'); -- First argument supplies the string.

    Since you already stated that there's no error message 50001 defined in sys.messages you receive the error. Change the code to this and it should work:

    RAISERROR (50001,

    N'xp_cmdshell call in [dbo].[adminManagePartition_Trace] failed. Purge not complete.',

    16,1)

    [font="Verdana"]Markus Bohse[/font]