HI all,
In SQL Server, i have a function which will return a table. like
create function fn_test (@t int) returns table as
return (select * from table)
now i want the function to retun the table based on some condition like below
create function fn_test(@t int) returns table as
if @t = 1 return (select * from table1)
else return (select * from table2)
It is not working for me. Please give me your suggesstions. It's very urgent.
Thank you in advance....