将特殊字符插入SQL Server 2008数据库 [英] Insert special characters into SQL Server 2008 database

查看:151
本文介绍了将特殊字符插入SQL Server 2008数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

The ' ' character cannot be included in a name.

我使用日志管理器将错误记录到SQL Server 2008数据库中.当然,这将在SQL Server中引发另一个错误,因为它包含特殊字符' '.那么在SQL Server中处理特殊字符的最佳方法是什么.

I use a log manager to log the error to SQL Server 2008 database. Of course, it will raise another error in the SQL Server because it contains special characters' ' . So what is the best way to handle special characters in SQL Server.

推荐答案

要获取处理特殊字符的列,请将其定义为NVARCHAR而不是VARCHAR.

To get a column to handle special characters define it as a NVARCHAR instead of a VARCHAR.

这篇关于将特殊字符插入SQL Server 2008数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆