Article

OpenEdge 37000: [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword '<fieldname>'.

« Go Back

Information

 
Article Number000034654
EnvironmentProduct: OpenEdge DataServer for MS SQL Server
Version: 10.x,11.x
OS: All Supported Operating Systems
Question/Problem Description
Errors during migration of an OpenEdge database to MS SQL Server database.

 
Steps to Reproduce
Clarifying Information
SQL Script generated by the 'OpenEdge database to MS SQL Server' migration utility

Issue occurs when loading the generated SQL migration script into the SQL Server database

Using the ODBC Wire Protocol Driver for MS SQL Server
Error Message37000: [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'external'.

37000: [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword '<fieldname>'.

37000: [Data Direct][ODBC SQL Server Driver][SQL Server]The object '<tablename>' does not exist or is invalid for this operation.


37000: [Data Direct][ODBC SQL Server Driver][SQL Server]The object 'tablename' does not exist or is invalid for this operation.

[Data Direct][ODBC SQL Server Driver][SQL Server]Could not find object '_TI_tablename' or you do not have permission.

[Data Direct][ODBC SQL Server Driver][SQL Server]Cannot find the object "tablename" because it does not exist or you do not have permissions.

WARNING Object Name: _TI_tablename - Type: Trigger not created!
Defect/Enhancement Number
Cause
 In the affected tables, there is a field called "external". Yet, "external" is a reserved word in SQL Server, causing the table creation to fail, including the table's related objects, such as stored procedures, indexes, sequences.
Resolution
 In order to access field names  are also reserved keywords, double quotes with ANSI mode enabled or back thicks must be used.

This operation is performed at the driver level. In your ODBC driver configuration, check the option "Enable quoted identifiers" in the advanced tab. 
 
This option will quote any table name, field name, index and prevent the error from occuring. 
 
"Use ANSI quoted identifiers" is the equivalent option for the SQL Native client driver and is enabled by default. 
Workaround
Notes
References to other documentation:

Reserved Keywords (Transact-SQL). In Microsoft MSDN. Retrieved October 22, 2012, from http://msdn.microsoft.com/en-us/library/ms189822.aspx
Attachment 
Last Modified Date2/27/2018 4:52 PM
Disclaimer

The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.



Feedback
 
Was this article helpful?

   

Your feedback is appreciated.

Please tell us how we can make this article more useful. Please provide us a way to contact you, should we need clarification on the feedback provided or if you need further assistance.

Characters Remaining: 1025