I am wondering what the literal for a Null character (e.g. \'\\0\') is in TSQL.
Note: not a NULL field value, but the null character (see link). >
I just ran the test below on my server (2008) and it was successful. It may have to do with an ANSI setting. I'll try flipping some settings here and see if I can reproduce your issue.
DECLARE @test_null_char VARCHAR(20)
SET @test_null_char = 'aaa' + CHAR(0) + 'bbb'
SELECT @test_null_char -- Returns "aaa bbb"
SET @test_null_char = REPLACE(@test_null_char, CHAR(0), 'ccc')
SELECT @test_null_char -- Returns "aaacccbbb"