Closed
Description
QueryBuilder replaces an apostrophe in a string with a backslash(es) followed by an apostrophe.
This leads to a SQL execution error in a SQL Server query.
Instead, SQL Server requires a double apostrophe.
Steps to Reproduce:
- Open the demo page https://querybuilder.js.org/demo.html and go to the last section "Import/Export".
- Add a "contains" rule for a field "name" and enter the value "D'Artagnan".
- Click the button "SQL".
- Copy the resulting SQL condition
name LIKE ('% D \\' Artagnan% ')
and use the condition in a sql statement like this:
SELECT * FROM [Musketeers] WHERE [name] LIKE ('% D \\' Artagnan% ')
- Running this query on SQL Server results in the following error:
Execution failed due to an unexpected error:
SQL Execution error: A fatal error occurred.
Incorrect syntax was encountered while [Statement] LIKE ('% D \' Artagnan% ') was being parsed.
Metadata
Metadata
Assignees
Labels
No labels