|
|
|
SSC 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
|
|
|
|
|
Right 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
|
|
|
|