开发者

How can I send null value to clr function?

开发者 https://www.devze.com 2022-12-31 19:11 出处:网络
When I\'m trying to create a clr functi开发者_StackOverflow社区on with nullable parameter (any kind), the function does not created in the DB.

When I'm trying to create a clr functi开发者_StackOverflow社区on with nullable parameter (any kind), the function does not created in the DB.

Does anyone know how I can do it?


DB: SQL Server 2008 I'm using .NET vs2008 clr functions

nevermind the code I was trying to send null to a date parameter, when I used the SqlDateTime type I could do it, it allows sending null (SqlDateTime.Null).

thanks a lot.


You need to create your CLR function using SqlType parameters instead of regular parameter types, See http://msdn.microsoft.com/en-us/library/system.data.sqltypes.aspx for a reference for the SqlType parameters that you can use.

0

精彩评论

暂无评论...
验证码 换一张
取 消