views:

216

answers:

2

I'm investigating some of the newer technologies available in SQL Server 2005/2008. Most of my applications are written in C# and generally have a database component. Most of what I find on Google are the basic, 'This is how you set up a CLR UDT'. I have a few general questions on their real-world application and use.

  • Are CLR hosted UDTs commonly used in applications? Large or small scale
  • Are there performance concerns with using them?
  • Do DBAs generally prefer only using the built-in types?

They seem like a way to just cram an object into a table. Am I correct in assuming that the actual range of problems that have simplified solutions because of their use is minimal?

+1  A: 

I investigated using them, but became uneasy over versioning. What happens if you upload a newer version of the assembly onto the server? Because of dependencies, you'd have to drop the UDT and recreate it, but what then happens to the data? We stick with built-in types.

jalbert
+1  A: 

UDT's only have a benefit when they truely represent some fundamental item of your application. Almost always they can be broken down to in built types but the benefits are that you don't have to cast the returned object. So you probably shouldn't use UDT's that represent complex objects such as Employee, but something fundamental like Size or Location could be a good choice because it's light but very rigid in it's definition.

Michael Prewecki