如何插入包含单引号字符的字符串?

时间:2013-06-03 04:30:06

标签: sql-server-2008 insert

我在SQL Server 2008中遇到此insert查询的问题

insert into Book values('B0000001I002','C# 3.0: A Beginner's Guide')

如何让SQL忽略C# 3.0: A Beginner's Guide中的单引号?

3 个答案:

答案 0 :(得分:7)

这个问题是asked before,答案是通过加倍来逃避'

INSERT INTO Book VALUES('B0000001I002','C# 3.0: A Beginner''s Guide')

答案 1 :(得分:0)

答案 2 :(得分:-1)

尝试

insert into Book values('B0000001I002','C# 3.0: A Beginner\'s Guide')