问题描述
我的一个数据库表字段插入&符号,如PIA和R009。当我使用select语句检索数据时,它显示PI R009。我该怎么办呢在此先感谢。
One of my database table field insert "&" sign like PIA&R009.when I retrieve the data using select statement its showing PI R009. How can I handle this. Thanks in advance.
推荐答案
& amp ;
(没有空格)它应该没问题。
但是从数据库开始:检查列定义(NVARCHAR应该是无论如何都可以,但是VARCHAR可能会导致转换问题,因为前者是UNICODE而后者不是 - 不太可能,但值得一看。然后检查列内容并确保它真正是&字符而不是其他一些看起来像正确字体的Unicode符号。
(without the spaces) and it should be fine.
But start with your database: check the column definition (NVARCHAR should be fine regardless, but VARCHAR may cause a conversion problem as the former is UNICODE and the latter isn't - not likely, but it's worth a look). Then examine the column content and make sure that it genuinely is an "&" character rather than some other Unicode symbol that looks like it in the correct font.
这篇关于如何检索“&”来自数据库领域。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!