2

I have a problem with this insert query in SQL Server 2008

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

How do I make SQL ignore the single-quote in C# 3.0: A Beginner's Guide?

doubleDown
  • 8,048
  • 1
  • 32
  • 48
sonas sonas
  • 197
  • 1
  • 5
  • 15

3 Answers3

7

This question was asked before and the answer is to escape the ' by doubling it:

INSERT INTO Book VALUES('B0000001I002','C# 3.0: A Beginner''s Guide')
Community
  • 1
  • 1
Burhan Khalid
  • 169,990
  • 18
  • 245
  • 284
-1

Try

insert into Book values('B0000001I002','C# 3.0: A Beginner\'s Guide')
sarwar026
  • 3,821
  • 3
  • 26
  • 37
  • Whoever gave downvote, please check the answered time, I didn't copy paste from another, I give the answer first and who earn 5 votes, he give the answer4 minutes later! – sarwar026 Oct 16 '16 at 04:08