Possible to intercept and alter SQL Queries in the engine before it gets executed? I've given up trying to fix a php program (which is of course geared to MySQL) running on SQL Server.

[Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Incorrect syntax near '`'. for query UPDATE wp_posts SET post_author = yyy, post_date =  N'2017-04-16 16:52:44.000', post_date_gmt =  N'2017-04-16 14:52:44.000', post_content =  N'\\ \', `post_content_filtered` =  N'', `post_title` =  N'test \\', `post_excerpt` =  N'', `post_status` =  N'draft', `post_type` =  N'post', `comment_status` =  N'closed', `ping_status` =  N'open', `post_password` =  N'', WHERE ID = xxx made by edit_post, wp_update_post, wp_insert_post, pdo_wpdb-&gt;query, pdo_wpdb-&gt;_post_query, pdo_wpdb-&gt;print_error


Is it possible to create a filter on a specific database only, and remove all the backticks / grave symbols in order to sanitize all incoming queries?
No, it is not possible to intercept and alter queries.

If somebody dangled millions of dollars in front of me to pull it off, I can imagine building a wire-compatible app that acted as if it was taking queries, then rewrite them and pass them off to another layer. However, that's not a small exercise, and it's left for the reader. This is the kind of thing GreenSQL (now Hexatier) was doing, sitting in between the apps and SQL Server, doing caching and auditing.