How to automate escaping apostrophes in sql

Internal error.

Oops! Looks like something went wrong!