In this post we will discuss how to return multiple values from a sql server function in sql server 2012. Here my requirement is I want to return multiple values through function.
You can also check:
In this case we have to define a Table-valued function. Below is the syntax.
ALTER function [dbo].[fnGetTags]
RETURN (SELECT TagID,TagName FROM Tags WHERE TAGID in (Select Top 1 TagID from DiscussionTags where DiscussionID= @DiscussionID))
To call this function you can use like below:
SELECT * FROM [dbo].[fnGetTags](1)