I am using the ExcelSQL add-in to extract data from a series of cells in an Excel worksheet and then push them into a SQL table.
The problem I've run into is that if the text in the cell contains an apostrophe ('), SQL reads that as a break in the instruction code.
For example, my code reads as follows:
INSERT into TABLE (Field_Name) values ('{A1}')
(where {A1} is the cell name within the worksheet). This works beautifully until I get to a text with an apostrophe; then SQL truncates the text, and receives an error, because it now has an unclosed quotation mark.
Following is the actual error I receive:
Error in ExcelSQL cell note in $A$2, data source CAM:
[Microsoft][ODBC SQL Server Driver][SQL Server]Line 2: Incorrect syntax near '‘'.
[Microsoft][ODBC SQL Server Driver][SQL Server]Unclosed quotation mark before the character string 's divorce.’, ‘’, ‘’, ‘’) '.
ODBC--call failed.
Any suggestions would be appreciated.
Thanks,
~Lacy
The problem I've run into is that if the text in the cell contains an apostrophe ('), SQL reads that as a break in the instruction code.
For example, my code reads as follows:
INSERT into TABLE (Field_Name) values ('{A1}')
(where {A1} is the cell name within the worksheet). This works beautifully until I get to a text with an apostrophe; then SQL truncates the text, and receives an error, because it now has an unclosed quotation mark.
Following is the actual error I receive:
Error in ExcelSQL cell note in $A$2, data source CAM:
[Microsoft][ODBC SQL Server Driver][SQL Server]Line 2: Incorrect syntax near '‘'.
[Microsoft][ODBC SQL Server Driver][SQL Server]Unclosed quotation mark before the character string 's divorce.’, ‘’, ‘’, ‘’) '.
ODBC--call failed.
Any suggestions would be appreciated.
Thanks,
~Lacy