Here's one that I wrote for the SQL Server 2008 Jumpstart program. There is
no tutorial other than that UDAs with more than one parameter are supported.
This example also illustrates use of .NET nullable types in SQLCLR. Be
warned that neither multi-input UDAggs or nullable types is supported with
Visual Studio 2008 SP1 auto-deploy. The .sql file to manually deploy and
test it is enclosed.
Hope it gets by the attachment filter on this NG.
Hope this helps,
Cheers,
Bob Beauchemin
SQLskills
> This example also illustrates use of .NET nullable types in SQLCLR. Be
Hi Bob,
Interesting examples. But I'm a bit confused by your use of the nullable
types; why use Nullable<decimal> rather than the decimal? shorthand?
Personally, I've been sticking with the SqlTypes whenever possible, and
teaching the same. Do you have a preference for one over the other?
--
Adam Machanic
Full-Day SQLCLR Seminar, December 1 2008, Montreal
http://www.devteach.com/PreConference.aspx#PreSQL
Bob Beauchemin - 30 Oct 2008 02:53 GMT
It's written the way it is for exposition. ;-) Some types don't support
SqlTypes (there is no SqlDateTimeOffset, for example). Some (reference types
like string) don't support nullable types. So it's not possible to use only
one or the other.
Cheers,
Bob Beauchemin
SQLskills
>> This example also illustrates use of .NET nullable types in SQLCLR. Be
>
[quoted text clipped - 9 lines]
> Full-Day SQLCLR Seminar, December 1 2008, Montreal
> http://www.devteach.com/PreConference.aspx#PreSQL