最近的工作一直都是弄sql developer和sql server之间的数据问题,因此发现了关于两者之间的很多不同,从语法,到排序规则,到对数据的格式要求。今天碰到了关于"&"的转义问题。在sql developer上很简单,有很多方法可以实现,但在sql server上却是一个又一个的方法尝试失败。最后还是问了一位大牛,才解决了问题。这里分享一下:
如:需插入的某字段字值为 'd>s'
sql developer上的解决方法:
1. set define off 关闭特殊字符的识别
2.'d' ||'&' || 'gts'
还有其他方法
sql server:
1.N'd>s'(目前只发现这一种方法)