We've got a stored procedure that's running in a SQL Server agent job on multiple servers. It has the little block of code to log debugging information. It's the same code on both machines, but on one machine the message is coming out garbled and the other clean. I don't see why it's behaving differently on the different servers.
DECLARE @NumToProcess VARCHAR(5) SELECT @NumToProcess = COUNT(*) FROM @ProcessingIDs IF(@NumToProcess = 0) BEGIN RAISERROR('Nothing to process', 10, 1) WITH NOWAIT RETURN END ELSE BEGIN DECLARE @Message VARCHAR(100) SET @Message = 'Processing ' + @NumToProcess + ' events' RAISERROR(@Message, 10, 1) WITH NOWAIT END
On one server I get the expected result in the Agent job history when there are records to process (e.g "Processing 105 events [SQLSTATE 01000] (Message 50000)")
But on the other server I see slight variations on this
...vents [SQLSTATE 01000] (Message 50000) ...ts [SQLSTATE 01000] (Message 50000) ...ents [SQLSTATE 01000] (Message 50000)
Not only is the "Processing " replaced with ..., parts of the word after the number gets consumed too.
The code looks dirt simple. Can someone explain why the one server could be producing this result?