March 2004 - Posts

A week ago I wrote about the new and enhanced task dll for deployment of CLR assemblies to Yukon. Even though it was fairly functional at that time, there were a couple of things in it (or rather not in it) which I didn't like.

So I bit the bullet and fixed it. The new release has following added functionality:

  • It can deploy CLR classes as SQL Server Yukon User Defined Types (UDT's).
  • It can deploy CLR classes as SQL Server Yukon User Defined Aggregates (UDA's).
  • If a UDT is used indirectly in Yukon (as a column type in a table for example) the table(s) or column(s) are dropped when re-deploying. Whether to drop the whole table or just the column(s) is user defined in the build file.
  • Likewise, if a CLR method is used indirectly in Yukon (a UDF being part of a column definition etc.) the indirect dependencies are dropped when re-deploying. The handling of tables/columns are the same as for UDT's.

I am pretty pleased with the (so far) end result. Please download it if you want and comment here on what you think about it and what features you like, don't like want to see added, removed etc.

In an earlier post I wrote how I had created a custom MSBuild task to deploy CLR assemblies to Yukon. It turned it was more useful than I first had thought (with automatic deployment in VS.NET and all). First, I do not always use VS.NET (Emacs is a great editor), and secondly even when I use VS.NET the deployment feature is a bit shakey.

So a while ago I decided to enhance the task a bit (among other thngs it didn't do cataloging of procedures etc based on the methods in the assembly. Some of the new features are:

  • Cataloging of procedures, UDF's and triggers based on the methods in the assembly.
  • This can be done by the task by inferral based on the return value of the CLR methods. Void and integer creates procs, everything else creates functions. Triggers can not be created this way.
  • If not using inferral the developer can define what a methos should be created as by using attributes. There are custom attributes for Procedures, Triggers and Functions. There is also an attribute to define size of parameters and return values.
  • In addition to deploying the assembly and its methods to the database the task can also output a script file with the T-SQL syntax fro the deployment. The developer can choose to either just deploy witn no file, deploy with file or just create the file and no deployment.

The code, binaries and documentation can e downloaded from here (about 66k). Have fun and comments are always welcome!!

Posted Sunday, March 14, 2004 4:14 PM by nielsb | with no comments
Filed under:

It appears I forgot the URL to the C# teams blog in my previous post. Thanks to Lyndon for pointing it out. Well here it is, and here is the rss feed.

I may be the last person noticing this, but the C# team at Microsoft havce their own blog. They post mainly FAQ, and it is really interesting to hear answer to questions why C# doesn't implement multiple inheritance, default parameters etc. Well worth subscribing.