Bob Beauchemin was experimenting with .Net UDTs, and their query results in SSMS when he came upon an interesting bugfeature.  If you create a .Net UDT, deploy it to SQL Server, use it as a column in a table, insert a row into that table, and do a “select *” on that table, you get an error:

An error occurred while executing batch. Error message is: File or assembly name 'MyNewType, Version=1.0.0.0, Culture=neutral, PublicKeyToken=17177e16a4b86577', or one of its dependencies, was not found.

This is because SSMS is just another client for SQL, and as such, uses ADO.Net to query it... which means that the custom UDT you deployed to the server must also be deployed to the machine you're using SSMS from in order to properly disply the value.  Yuck.

In the comments, Angel Saenz-Badillos, an ADO.Net guy from MS, mentions that he doesn't like this behavior, and wants feedback to determine how best to go about this issue.  So, jump on over to either Bob's entry and leave comments, or shoot them stright to Angel himself.  I personally would prefer that in order to get a value back, you have to define a ToString method; how about you?

- G



Creative Commons License This work is licensed under a Creative Commons License.