开发者

How to call a tsql function inside a vb.net function?

开发者 https://www.devze.com 2023-02-18 23:15 出处:网络
I arrive from years with Oracle plsql. Now I\'m trying vb.net I created a function that return a ch开发者_运维技巧ar value, so written:

I arrive from years with Oracle plsql. Now I'm trying vb.net

I created a function that return a ch开发者_运维技巧ar value, so written:

ALTER FUNCTION [abc].[GET_PERSON_TYPE]
( 
@person_national_id CHAR(16)
)
RETURNS CHAR(1) AS
BEGIN 

declare @person_type CHAR(1)

SET @person_national_id = (
                SELECT p_type
                FROM abc.persons
                WHERE national_id = @person_national_id
                )

RETURN @person_national_id

END

The question: I will create a function get_type(...) in vb.net that calls the tsql function written above... how can I call the tsql function [abc].[GET_PERSON_TYPE] in vb.net function get_type(...) function?

Thanks a lot.


I don't think you can call the function directly but you can use it in a select statement.

select [abc].[GET_PERSON_TYPE]('abcde')
0

精彩评论

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