<div dir="ltr"><span style="font-size:12.8px">Hi there,</span><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">The Issue:</div><div style="font-size:12.8px">I am trying to use ogr2ogr to put a shapefile into a SQL Server table that is also an esri geodatabase.  I have done this successfully before in the past with SQL Server 2012 and esri 10.2, running from C#.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I am now attempting to do it with SQL Server 2014 and esri 10.2.2, running from Python, and am running into a confounding and frustrating issue.  If I run the following command on a regular SQL database, it works just fine:</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">'ogr2ogr -f "MSSQLSpatial" "MSSQL:server=server;database=database;trusted_connection=yes;" "C:/Users/username/Desktop/Test_Shapefile.shp" -lco "SRID=4326" -lco "GEOM_TYPE=GEOMETRY" -lco "SCHEMA=DBO" -lco "OVERWRITE=YES" -nln "TEST_TABLE" -overwrite'<br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">If I point it to an esri geodatabase, however, I get this error:</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><div>ERROR 1: Error initializing the metadata tables : [Microsoft][ODBC SQL Server Driver][SQL Server]There is already an object named 'geometry_columns' in the database.</div><div>ERROR 1: Error initializing the metadata tables : [Microsoft][ODBC SQL Server Driver][SQL Server]There is already an object named 'geometry_columns' in the database.</div><div>ERROR 1: Terminating translation prematurely after failed</div><div>translation of layer Test_Shapefile (use -skipfailures to skip errors)</div></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Interestingly, if I make an ogrinfo connection to the same database, I get:</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><div>ERROR 1: Error initializing the metadata tables : [Microsoft][ODBC SQL Server Driver][SQL Server]There is already an object named 'geometry_columns' in the database.</div><div><br></div><div>INFO: Open of `MSSQL:server=MAPLION-PC;database=GIS;trusted_connection=yes;'</div><div>      using driver `MSSQLSpatial' successful.</div></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">followed by a listing of my tables in the database.  This happens for every SDE/geodatabase-enabled database I have tried it on.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Does anyone have any ideas what may be causing this issue?  Thank you.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">-Ryan</div></div>