Reputation:
Can this be done? Or are all CLR UDTs in SQL Server just utilized in SQL Server?
Upvotes: 0
Views: 488
Reputation: 294297
Yes. The UDT assemblies and all dependent assemblies have to be on the client already, accessible either in the application folder or on the GAC. Your project must reference the UDT assembly bytes, or it has to load the UDT at runtime prior to referencing the UDT type column. This MSDN link explains all the requirements your UDT has to meet before ADO.Net can instantiate them in your client. Needlses to say, your UDT code should not assume it runs in the SQL CLR runtime, ie. should not attempt to open a 'context' connection or anything SQL specific.
Upvotes: 2