Monday, March 12, 2012

how to use non-basic AscII character in Stored procedure parameter

hi all,

I have a stored procedure with a input parameter ( xml block).

sp: spGetAddr @.xmlText

the style of parameter @.xmlText looks like

<Param RestricBy="UserName IN ('Mayá', 'Bob')"/>

If I use non-basic ASCII character, just like 'á' in the parameter, the execution fails and I get 'The error description is 'An invalid character was found in text content.''

But this kind of special characters should be allowed in the name column of the database table.

If I use the htlm code '&#xE1" to replace 'á' in the parameter, then the execution of the stored procedure is fine. but how can I change all of the possible sepcial characters?

If somebody knows how to handle this issue, please help me. I'm pre-appreciated for all the idea and suggestion!

Thanks,

Jone

What happens when you preface the string with the unicode identifier [ N ]?

<Param RestricBy="UserName IN (N'Mayá', 'Bob')"/>

|||

Thanks for your reply.

after preface 'N', I still got the same error.

Any idea?

Thanks,

Jone

|||

Perhaps this will prove useful for you:

http://blogs.msdn.com/mrys/archive/2005/09/06/461682.aspx

No comments:

Post a Comment