English

Bug: When copying data into a geodatabase, underscores are added to object names

Description

When copying data into a geodatabase, objects are renamed to include an underscore character.

Cause

The original name of the object corresponds to a reserved keyword in the underlying destination DBMS.

Workaround

Rename the object in the origin geodatabase to a name that does not conflict with any reserved keywords in the destination DBMS and copy the data again.

The following code example can be used to get the list of reserved keywords. Select the Geodatabase in ArcCatalog and run the macro.

Code:
Public Sub GetDatabaseKeywords()
Dim pApp As IGxApplication
Dim pGxObj As IGxObject
Dim pGxDB2 As IGxDatabase2
Dim pSDEWS As IWorkspace
Dim pSQLSyntax As ISQLSyntax
Dim pDBConnInfo As IDatabaseConnectionInfo

Set pApp = Application
Set pGxObj = pApp.SelectedObject
'If for some reason we're not connected to a GDB, Exit
If Not TypeOf pGxObj Is IGxDatabase2 Then Exit Sub
Set pGxDB2 = pGxObj
Set pSDEWS = pGxDB2.workspace

Set pSQLSyntax = pSDEWS

Dim pEnumBSTR As IEnumBSTR
Dim str As String
Set pEnumBSTR = pSQLSyntax.GetKeywords
pEnumBSTR.Reset
str = pEnumBSTR.Next
Do Until str = ""
Debug.Print str
str = pEnumBSTR.Next
Loop

End Sub