Previous Thread:   Updated Version of SqlClrProject

1/13/2006 2:17:53 AM    Re: Attribute on return value, how ??
"Soren S. Jorgensen" <nospam@nodomain.com> wrote in  
  
news:ugKr3uBGGHA.3944@tk2msftngp13.phx.gbl:  
  
Glad you figured it out. Just a little tip, if you were to use SqlChars  
  
instead of SqlString VS would default to nvarchar(max) (if you're using  
  
the SQL Server Project).  
  
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  
  
**************************************************



1/13/2006 9:17:00 AM    Attribute on return value, how ??
Hi,  
  
How do you set an attribue on a return value ??  
  
I need to return nvarchar(max) on my CLR function, but cannot remember how  
  
to write this :-/  
  
[SqlFunction(Name= "....")]  
  
public static SqlString MyClrFunction(  
  
[SqlFacet(MaxSize = -1)] SqlString ID,  
  
[SqlFacet(MaxSize = -1)] SqlString Name,  
  
)  
  
{  
  
return new SqlString("Some data"};  
  
}  
  
Where do I put the SqlFacetAttribute on my return value ??  
  
In advance, thanx  
  
Soren

1/13/2006 9:31:12 AM    Re: Attribute on return value, how ??
Arrhhh - just forget it, figured it out :-)  
  
[SqlFunction(Name= "....")]  
  
[return: SqlFacet(MaxSize = -1)]  
  
public static SqlString MyClrFunction(  
  
[SqlFacet(MaxSize = -1)] SqlString ID,  
  
[SqlFacet(MaxSize = -1)] SqlString Name,  
  
)  
  
{  
  
return new SqlString("Some data"};  
  
}  
  
Soren  
  
"Soren S. Jorgensen" <nospam@nodomain.com> skrev i en meddelelse  
  
news:OPXE8mBGGHA.3892@TK2MSFTNGP12.phx.gbl...

1/13/2006 5:52:27 PM    Re: Attribute on return value, how ??
Hi Niels,  
  
Thanx for the tip...  
  
Actually, when using your deployment solution, am I right when your are  
  
trying to deploy every public static method in the assembly (not just those  
  
that are marked with one of the Microsoft.SQLServer.Server attributes) ??  
  
Apart from the above, the new version rocks!!  
  
Btw. thanx for a great course at MS-DK in December :-)  
  
Soren  
  
"Niels Berglund" <nielsb@develop.com> skrev i en meddelelse  
  
news:Xns974A68C0763D1nielsbdevelopcom@207.46.248.16...

1/14/2006 9:03:15 AM    Re: Attribute on return value, how ??
"Soren S. Jorgensen" <nospam@nodomain.com> wrote in  
  
news:#mH49GGGGHA.4040@TK2MSFTNGP10.phx.gbl:  
  
No, ony if you have the infer property set to true (false by default).  
  
Are you seiing something different?  
  
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  
  
**************************************************

1/14/2006 1:23:30 PM    Re: Attribute on return value, how ??
"Soren S. Jorgensen" <nospam@nodomain.com> wrote in news:u8VSEaTGGHA.140  
  
@TK2MSFTNGP12.phx.gbl:  
  
Good.  
  
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  
  
**************************************************

1/14/2006 7:15:33 PM    Re: Attribute on return value, how ??
Ahh, unchecking this property was a big help. Sorry!  
  
Soren  
  
"Niels Berglund" <nielsb@develop.com> skrev i en meddelelse  
  
news:Xns974BAD7B517EBnielsbdevelopcom@207.46.248.16...