I am evaluating working with user-defined types in our project, especially hierarchyID.
I encountered three questions I fail to answer myself. In my setup I'm using SQL Server 2014, SQL Server Native Client 11 and SDAC 7.1.3 / 7.3.12.
When accessing a hierarchyID field with the AsUDT property as demonstrated in the demo project I encounter an error due to wrong assembly version of 'Microsoft.SqlServer.Types.dll'. Version 11 of it is tried to being used but not accessible. Where is this version 11 coming from? The version of the assembly in the database is 12, so is the Native Client telling SDAC to use version 11? If that's the case is there any way to influence that?
If I try to pass a hierarchyID from a field to a parameter of a stored procedure, execution of the procedure fails with an 'Operand type clash: image is incompatible with hierarchyid' error. When debugging it seems that the the SubDataType of the parameter is not set and thus using dstImage as ParameterBindingInfo DataSourceType.
I'm assigning the parameter value this way:
Code: Select all
StoredProc.ParamByName('HID').Value := AnotherStoredProc.FieldByName('HID').Value
TMSTableData seems not to support UDT fields. I could not access them with AsUDT and assigning a value with Value property caused an assertion error. Is this unsupported or did I do it the wrong way?