Previous Thread:   CLR Aggregate that does a query in Init

3/4/2006 4:00:46 PM    CLR Aggregate SqlFacet
Anyone have an example of how to set the SqlFacet on a CLR accumulator? I  
  
want to set precision and scale on a Decimal type.  
  
--  
  
____________________________________  
  
William (Bill) Vaughn  
  
Author, Mentor, Consultant  
  
Microsoft MVP  
  
INETA Speaker  
  
www.betav.com/blog/billva  
  
www.betav.com  
  
Please reply only to the newsgroup so that others can benefit.  
  
This posting is provided "AS IS" with no warranties, and confers no rights.  
  
__________________________________



3/4/2006 11:16:34 PM    Re: CLR Aggregate SqlFacet
"William \(Bill\) Vaughn" <billvaRemoveThis@nwlink.com> wrote in  
  
news:uO1Ecf#PGHA.2668@tk2msftngp13.phx.gbl:  
  
So the SqlFacet can be used for parameters and return types. If you want  
  
to use it for parameters you set it like so:  
  
void MyMethod([SqlFacet()] decimal param1){}  
  
for a return type yu do it like:  
  
[return:SqlFacet()]  
  
decimal MyOtherMethod(){}  
  
However, since this is an aggregate I'm not sure how the deployment  
  
mechanism of VS handles the creation of the aggregator function. If it  
  
doesn't work correctly, you can always catalogue the aggregator  
  
manually.  
  
Niels  
  
--  
  
**************************************************  
  
* Niels Berglund  
  
* http://staff.develop.com/nielsb  
  
* nielsb@no-spam.develop.com  
  
* "A First Look at SQL Server 2005 for Developers"  
  
* http://www.awprofessional.com/title/0321180593  
  
**************************************************