Database profile SQL Select error: Incorrect syntax near the keyword 'In'

Document created by pete_mccoy1.3055586893899446E12 Employee on Jan 24, 2014
Version 1Show Document
  • View in full screen mode
Select statement in DB operation returns the following error when run:

Execution of <Process Name> completed with errors. Embedded message: Severe errors occurred during start shape execution, terminating process.; Caused by: Errors occurred while building or executing SQL statement: Incorrect syntax near the keyword 'In'.; Caused by: Incorrect syntax near the keyword 'In'.

Here is listing of the Select Statement from the Profile:

SELECT AcquisitionName, CustomField1, CustomField10, CustomField2, CustomField3, CustomField4, CustomField5, CustomField6, CustomField7, CustomField8, CustomField9, Email, EmailOpt-In, EntryNumber, Fax from sometablename.
The word IN is a reserved word in SQL.  In order to make this select work without throwing an error, you must put square brackets around the column name that contains the reserved word as part of the column name.

SELECT AcquisitionName, CustomField1, CustomField10, CustomField2, CustomField3, CustomField4, CustomField5, CustomField6, CustomField7, CustomField8, CustomField9, Email, [EmailOpt-In], EntryNumber, Fax from sometablename.

Attachments

    Outcomes