I am cleaning up a SQL script to replace escaped apostrophes \' with '' as it is in MySQL syntax and I need it to work in MSSQL but no matter what I try it doesn't work. How do you replace escaped apostrophes with two apostrophes in a file with Python?
2 Answers
Create a store procedure the write the script to replace the special characters or regular expression like
`update table set column = REPLACE(column,"'",'"'); update table set column = REPLACE(column,"/","");
update table set column = REPLACE(column,"'",""");`
Reference : Remove special characters from a database field
And in the last call it by using Python script
EXEC PROC procedureName
1 Comment
user3882865
Thanks, but it's the actual SQL insert statement itself that needs the escaped apostrophe replaced with '', so I can actually run it to begin with.