Home > Blogs > Did you know that the + sign is Unicode? Me either...

Did you know that the + sign is Unicode? Me either...

By  Sep 8, 2008

Topics: SQL Server, Data

I was working with an application today that had an "Execute SQL Function", only I couldn't get it to work. I finally talked with the developer, and she told me that it was really using sp_executesql under the covers, although they re-wrapped it a bit.

So I tried the string I was sending as T-SQL in sp_executesql and sure enough, it failed there too. I had a concatenate function (the plus-sign) and it failed on a syntax error - until I added N' to the front of the string. Then it all worked. Turns out that the + sign in this situation is treated as Unicode, which I had to escape with the N' thing. It's not like you'll come up against this all the time, but there it is.