how create function with variable table code example
Example: sql server: how to assign value to table variable returned from function
INSERT INTO @tableVariableName
SELECT * FROM <schemaName>.<functionName>([@parameters_names, ..])
INSERT INTO @tableVariableName
SELECT * FROM <schemaName>.<functionName>([@parameters_names, ..])