Multi Line Net Send

  • Hi guys,

    I have a trigger that fires when a record with certain data is added to one of my tables.

    This trigger fires a "net send" message to their controller advising the data has been added. (code below):

    ALTER TRIGGER [dbo].[TEST]

    ON [dbo].[ENG_FSR_INPUT]

    AFTER INSERT

    AS

    BEGIN

    SET NOCOUNT ON;

    DECLARE @CALL int

    SELECT @CALL = Call_Num From ENG_FSR_INPUT

    DECLARE @PC nchar(10)

    SELECT @PC = Schedular_PC From ENG_FSR_INPUT

    DECLARE @Eng varchar(8)

    SELECT @Eng = Eng From ENG_FSR_INPUT

    DECLARE @cmd nvarchar(255)

    set @cmd = 'net send ' + @PC + ' "Report Added To ' + convert(varchar(255),@Call) + ' By ' + @Eng + '"'

    exec MASTER..xp_cmdshell @cmd

    Delete From ENG_FSR_INPUT

    END

    I would like this message to be a multi-line message, in CMD this is very easy however i'm having some trouble. i thought i would be able to do it by inserting ' +CHAR(10)+CHAR(10)+ ' into the code but this simply doesnt work....

    Any ideas??

    Thanks

    Sam Marsden

  • Maybe try char(13) + char(10) - '\r'

    Piotr

    ...and your only reply is slàinte mhath

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

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