Create a function which accepts one parameter and returns a table.
CREATE FUNCTION GetID(@num INT)
RETURNS TABLE
AS RETURN
(
SELECT @num+1 AS 'NUMBER'
)
Retrieve the function output using below query.
select * from
GetID(2)
Output:
Number
3
select * from
GetID(2)
Output:
Number
3
No comments:
Write comments