Introduction:
Here I will explain how SQL Server function will return multiple values in SQL Server 2008 or return multiple values from SQL user defined function in SQL Server 2008.
Description:
In
previous posts I explained SQL Server difference between view and stored procedure, SQL Server split function example to split comma separated
string, SQL Server update statement with inner joins, interview questions in asp.net, sql
server, c#
and many articles relating to SQL
Server.
Now I will explain how SQL
Server function
will return multiple values in SQL
Server
2008.
Whether functions will return multiple
values or not?
For
this question answer will be Yes
functions will return either single or multiple values.
Generally
SQL
Server
functions will return only one parameter value if we want to return multiple
values from function then we need to send multiple values in table format by
using table valued functions.
Sample
function which return table as parameter
|
We can call this function in our query like as shown
below
SELECT * FROM dbo.testmultiplevalues(14)
|
If
we run above query we will get output like as shown below
Demo
If you enjoyed this post, please support the blog below. It's FREE! Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email. |
|||
|
|||
12 comments :
Hello Sir,
Again Your Code Become Helpful for me
Thankyou Sir.
Hi I'm web developer and I find very interesting and useful your interview questions section.
Thank you
Hi I 'm web developer and I find very interesting and useful your interview questions section. Please Add more question and answer
Thanks
Hi Suresh,
Your website is very very useful. Please continue to support.
hai sir...u r way of telling is very simple and easy understable...please add experince interview questionssssss
thank u friend ..ur topics are very helpfull to us ..keep on posting the topics ..
Thanks for your posting tutor....
thanks ..sir your code is very helpful...
Really your website is very helpful.Thank u so much for your support sir...
Thank you for Sharing..
very good to understand
very good
Note: Only a member of this blog may post a comment.