February 22, 2008 at 8:36 am
I have a question....probably a dumb one, but
Is it possible to call user defined functions within unions
for example:
select 1, 2 from x
union
exec dbo.fnc_function1()
?
Thanks,
Michael
February 22, 2008 at 8:51 am
Functions don't get used with that particular syntax which is probably why you're having trouble. EXEC is for a stored procedure.
Try -
select 1, 2 from x
union
Select [3],[4] from dbo.fnc_function1()
Keep in mind all of the usual rules about union (same columns, in the same order with the same types) applies here.
----------------------------------------------------------------------------------
Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?
February 22, 2008 at 12:06 pm
Thanks!
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply