book
Article ID: KB0076174
calendar_today
Updated On:
Description
When using the SQL Connector with Microsoft SQL Server as a target, attempting to insert data into a Geometry field generates errors similar to the following:
"String cannot have zero length"
Message: Execute process failed:
Exception Type : FileNotFoundException
Message : Could not load file or assembly 'Microsoft.SqlServer.Types, Version=11.0.0.0
Note: This error was generated with Microsoft SQL Server 2016, but other versions could be affected as well. See the following Knowledge Base article: Sql Data Types Geography, Geometry, or Hierarchyid causes error ???The following error has occurred in the SQL Connector: DataReader.GetFieldType(3) returned null.???
(D44837)
Resolution
Workaround:
Install version 11.0.0.0 of the Microsoft.SqlServer.Types assembly.
IMPORTANT NOTE: Repeat this process for each server that hosts a TIBCO Scribe Online Agent used to execute Solutions with a Microsoft SQL Server target Connection.
Confirm That The File Is Not Already There
- On the affected machine, open Windows Explorer and navigate to C:\Windows\assembly to view the Global Assembly Cache (GAC).
- Scroll to the assembly labeled Microsoft.SqlServer.Types; there should be several versions of this file listed.
- Confirm that version 11.0.0.0 is NOT present. If the file is not present, add the file to the GAC.
Add The Version 11.0.0.0 File To The GAC
- Open a Command Prompt as Admin.
- Navigate to the NETFX<versionnumber> Tools directory. This directory may be located in one of the following areas:
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools
or
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools
- Execute the following command, which references the specific TIBCO Scribe Online Agent being used.
gacutil /i "C:\Program Files (x86)\Scribe Software\<your scribe agent>\Connectors\Scribe.Adapter.Sql\Microsoft.SqlServer.Types.dll"
- Return to Windows Explorer.
- Navigate to C:\Windows\assembly and verify that Microsoft.SqlServer.Types version 11.0.0.0 is now installed in the GAC.
- Open TIBCO Scribe Online and run the Map with the error.
- If the error is still received an agent restart may be required.
Issue/Introduction
When using the SQL Connector with Microsoft SQL as a target, attempting to insert data into a Geometry field generates errors.