Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Parsing error with a special character

$
0
0

I have a stored procedure that I am passing in to it a parameter that has a "special" character; in this case the character is the degree sign °, but in another case I received the same error when using the character of an "e" with an accent above it. When I log on to the server and run Management Studio directly on the server that the database lives on, I get an error when parsing this script.

The SQL I am running is as follows:

DECLARE @GUIDOutput UNIQUEIDENTIFIER
EXEC spMyStoredProcedure '129cd8fc-def4-488c-a55b-8f50c8ea6e38', 'N 40.4298° W 105.04096°', '1A99A369-777B-4E84-B6B3-B5C2B7D79A62', @GUIDOutput OUTPUT

The error is:
Query completed with errors:
Msg 102, Level 15, State 1, Line 2
Incorrect syntax near '1'.

The second parameter has the degree sign, and the error seems to think that the quote ending the text is not closed, hence the incorrect syntax error.

But when I log on to another server and connect to the same database using that other server's instance of Management Studio, everything works fine. The store procedure executes without error, and the data appears correctly in my application with the degree signs.

I can only think that there must be some setting that is different in the two different instances of Management Studio on the two servers, but I cannot think what it could be. I'm using Management Studio version 10.0.5500.0 in both cases. The collation on the database is SQL_Latin1_General_CP1_CI_AS. I have also tried setting Quoted identifier on and off and it has made no difference.


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>