如何在SQL Server中修改或转义以下插入查询:
INSERT INTO <tblname> (title,desc)
VALUES
('Hen's Body','It's just best combination')
此查询不在SQL Server中运行。我需要MySQL的similer解决方案(比如使用反斜杠),因为它是
INSERT INTO <tblname> (title,desc)
VALUES('Hen\'s Body','It\'s just best combination')
此致
答案 0 :(得分:3)
将单引号加倍以逃避它们:
INSERT INTO ( title, description )
VALUES ( 'Hen''s Body', 'It''s just best combination' )