Я определил пользовательский тип как
namespace AddOns{
[SqlUserDefinedType(typeof(JsonObjectFormatter))]
public class JsonObject
{
public string Value {get;set;}
... // this is just a dummy representation
}
}
Я хочу определить табличную функцию, которая возвращает тип данных
REFERENCE ASSEMBLY [AddOns];
CREATE TYPE Insight.dbo.JsonRow
AS TABLE
(
[Id] Guid,
[Value] AddOns.JsonObject
);
Однако я получаю сообщение об ошибке
'E_CSC_USER_INVALIDCOLUMNTYPE: 'AddOns.JsonObject' cannot be used as column type.
Description:
The column type must be a supported scalar, complex or user defined type.
Resolution:
Ensure the column type is a supported type. For a user defined type, make sure the type is registered, the type name is fully qualified, and the required assembly is referenced by the script.'
*** Compile failed !
Я зарегистрировал соответствующую DLL в своем локальном экземпляре ADLA, и я могу получить доступ к типу в инструкциях процедур SELECT
, когда сохраняю данные в файл. Но не может вернуть его как тип возврата TVF