var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: return multiple values from a function
searched all over, couldn't find a solid answer...is it possible to return multiple values from a sql function with sql server 2005?
e.g., I want to do this:
select id, data, whatever, dbo.fnMyFunction(id, whatever) from table
and have the output have columns (id, data, whatever, col1, col2) where col1 and col2 are returned by fnMyFunction
possible? easier way? thanks in advance...
i guess returning multiple columns is not possible.....however if you write 2 functions for the two columns then it could be achieved something like
select id, data, whatever, dbo.fnMyFunction1(id, whatever), dbo.fnMyFunction2(id, whatever) from table
yeah, I was going to try that, but I thought it might be a performance drag since it's a fairly large amount of data I'll be returning. I'll try it anyway I guess, I shouldn't pre-judge sql server's optimization abilities
Function can return multiple values, Check Table-Valued functions in help.
Only think is you need to use it in where clause, something like :
Yourtable.id, Yourtable.data, Yourtable.whatever,
(Select * from dbo.fnMyFunction(id, whatever) ) as fnTable