Issues with different white space characters is a pain. You just need to use the CHAR/NCHAR function in the REPLACE, like this:
DECLARE @data NVARCHAR(MAX) = 'EXEC Proc_gen' + CHAR(9) + '@PsID=12, @kID=-1, @ID=3183';
SELECT @data AS theData ,
REPLACE(CHAR(9), REPLACE(@data, ' ', '')) AS dataNoSpaces;
This one does both the Tab and the space.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question