如何在SQL文件中转义引号?

如何在SQL文件中转义引号?,sql,Sql,我有一个很大的SQL文件,上面有这样的行 (NULL, "190", "1986-07-23", "Kyoko's Gift ! "What , You Mean it's For Me?"", "Godai gets depressed over the rain, remembering that some of the worst events of his life have occured on rainy days. Kozue visits Maison Ikkoku and he

我有一个很大的SQL文件,上面有这样的行

(NULL, "190", "1986-07-23", "Kyoko's Gift ! "What , You Mean it's For Me?"", "Godai gets depressed over the rain, remembering that some of the worst events of his life have occured on rainy days. Kozue visits Maison Ikkoku and her skirt gets stained so she and Kyoko have snacks together while they wait for the skirt to dry. Kozue asks about Godai and learns that Kyoko is a widow. Kyoko remembers trying to flirt with Soichiro when she was in high school . After Kozue leaves, Godai runs into Kyoko, and she invites him to share an umbrella with her as they head home.", "0", "25", "18", "1"),
问题是该行的一部分带有双引号:

,"Kyoko's Gift ! "What , You Mean it's For Me?"",

我总是会遇到一个错误,问题是有很多这样的行,有没有一种好方法可以避开所有必要的引号,使其正常工作?

我假设您使用的是SQL Server,请尝试以下方法:

'Kyoko''s Gift ! What, You Mean it''s For Me?' 

如果有大量查询需要转义引号,则需要在SSMS中使用Find/Replace或文本编辑器将引号替换为正确转义的引号

首先将单引号
'
替换为双引号
'
。 然后将双引号替换为单引号

最后,字符串周围应该有单引号,如下所示:
“Foo-Bar”
你的撇号应该省略,就像这样:
'It's my Foo Bar'

'
而不是
'
您所说的“SQL文件”是什么意思" ? “你是怎么处理的?”Devlenotate我的意思是,我有很多其他类似的行,我想一次修复所有行,而不是逐个修复one@PedroBarbosa:什么台词?数据库没有SQL文件。它有桌子。那么你到底在说什么呢?为了能够同时处理所有行,你需要知道如何处理一行。你已经知道怎么逃出一条线了吗?你能准确地定义你的问题是什么吗?但我还有很多类似的行,有没有办法解决所有的问题?而不是一次一个?你期望结果如何?研究正则表达式。。。匹配您要查找的内容并替换它。您可以使用记事本++进行此操作,它将允许您一次处理所有行: