开发者

Single quotes problem in SQL Server 2008

How this below insert query can be modified or escape single quote in SQL Server:

INSERT INTO <tblname> (title,desc)
VALUES
('Hen's Body','It's just best combination')

This query not run 开发者_StackOverflow中文版in SQL Server. I need similer solution to MySQL (like using backslash)as it is

INSERT INTO <tblname> (title,desc)
VALUES('Hen\'s Body','It\'s just best combination')

Regards


Double up the single quotes to escape them:

INSERT INTO ( title, description ) 
VALUES ( 'Hen''s Body', 'It''s just best combination' )
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜