John
John

Reputation:

Return CLR SQL Server UDT from SQL Server to client app?

Can this be done? Or are all CLR UDTs in SQL Server just utilized in SQL Server?

Upvotes: 0

Views: 488

Answers (1)

Remus Rusanu
Remus Rusanu

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

Related Questions