SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On



Multi Line Net Send Expand / Collapse
Author
Message
Posted Tuesday, November 10, 2009 7:07 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Tuesday, February 09, 2010 3:25 PM
Points: 40, Visits: 100
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
Post #816477
Posted Tuesday, November 10, 2009 5:23 PM


Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Today @ 2:54 PM
Points: 748, Visits: 1,516
Maybe try char(13) + char(10) - '\r'

Piotr
Post #816921
« Prev Topic | Next Topic »


Permissions Expand / Collapse