How to call a tsql function inside a vb.net function?
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')
精彩评论