Question

Issues retreiving data with microsoft SQL server Spatial reader

  • 13 October 2022
  • 4 replies
  • 40 views

Hi,

Microsoft SQL Server Spatial reader connects successfully to a SQL Server entreprise geodatabase however it fails to retreive spatial data,throwing this error :

 

Microsoft SQL Server Spatial Reader: Failed to load mssql_spatial_wrapper.dll. Cannot read/write curves and full globe and may orient geography incorrectly. Ensure Microsoft System CLR Types for SQL Server 2012 and Microsoft .NET Framework 4.5.2 (or higher) and are installedMicrosoft SQL Server Spatial Reader: Microsoft System CLR Types for SQL Server 2012 is available at http://www.microsoft.com/en-ca/download/details.aspx?id=29065. Please expand 'Install Instructions' and download 'SQLSysClrTypes.msi'

Microsoft SQL Server Spatial Reader: If you have confirmed that Microsoft .NET Framework 4.5.2 (or higher) is not installed, it is available at http://www.microsoft.com/en-ca/download/details.aspx?id=42643

Microsoft SQL Server Spatial Reader: Schema lookup query failed for table `domain\\TableName'. Provider error `(-2147217900) Incorrect syntax near '\\'.'

Microsoft SQL Server Spatial Reader: Failed to retrieve schema information for feature type `domain\\TableName'

 

I am using Arcgis Data Interoperability extension (FME 2021.1.2.0 (20210903 - Build 21627 - WIN64)) with ArcGIS pro 2.7, both in 64 bits, i have Microsoft SQL Server 2012 Native Client , Microsoft .NET Framework 4.5.2, ans also Microsoft OLE DB Driver 19 for SQL Server.

I have copied the mssql_spatial_wrapper.dll to C:\\Windows\\System32 and to C:\\Windows\\SysWOW64.

 

Any ideas please ?

 

Thank you in advance.

 


4 replies

Userlevel 3
Badge +16

The specific microsoft file you need to download and install from the link in the error message you provided is 'SQLSysClrTypes.msi'

  • The SQL Server System CLR Types package contains the components implementing the geometry, geography, and hierarchy id types in SQL Server 2012. This component can be installed separately from the server to allow client applications to use these types outside of the server.

 

There are newer versions of SQL spatial geometries which can't be read without it. Curves and whatnot. You can find them in your data with the function https://learn.microsoft.com/en-us/sql/t-sql/spatial-geometry/mindbcompatibilitylevel-geometry-data-type

The specific microsoft file you need to download and install from the link in the error message you provided is 'SQLSysClrTypes.msi'

  • The SQL Server System CLR Types package contains the components implementing the geometry, geography, and hierarchy id types in SQL Server 2012. This component can be installed separately from the server to allow client applications to use these types outside of the server.

 

There are newer versions of SQL spatial geometries which can't be read without it. Curves and whatnot. You can find them in your data with the function https://learn.microsoft.com/en-us/sql/t-sql/spatial-geometry/mindbcompatibilitylevel-geometry-data-type

I forgot to mention it in my post but the SQLSysClrTypes.msi is also installed and yet still have the error.

 

Userlevel 3
Badge +16

I forgot to mention it in my post but the SQLSysClrTypes.msi is also installed and yet still have the error.

 

Hm, in my experience installing that has always resolved that error. But I'm unfamiliar with the Arcgis Data Interoperability extension, so it could be different than just using FME desktop.

To separate the geometry read from the database read operation, you could maybe try read the table with a SQL non-spatial reader (or a SQLCreator with a non-spatial connection), and then use a GeometryReplacer on the SHAPE field.

 

I also don't like the look of the error about 'domain\\TableName'; table names shouldn't contain slashes. The first error describes the geometry not being able to be read, the second error describes the table not being able to be read.

I forgot to mention it in my post but the SQLSysClrTypes.msi is also installed and yet still have the error.

 

The tables names contain slashes because the SQL database uses windows authentication.

Reply