I am new to SQL Server and I would like to know how to return the exact columns of tables in UDFs.
The situation is like this : I am going to query a table and then return it again as table.
Example :
create function test
var t
set t = select * from table where condition
return t;
How am I going to do it?
(question is only how to return the table with dynamic fields)
Hope you understand the question. Thanks in advance
UPDATE : my question is somehow like how do I create a table variable where its columns are dynamic.