Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

Wiki Markup
Call parameterized functions within the FROM clause of a SELECT statement.
The function returns a table in a specified format and the results work like a table with the specified alias.
Table value functions can take 0-n nparameters.
Example - Shows how to declare a table value function that takes one parameter and outputs a table with two columns. @outputTable works as virtual table where the output goes.
create function tvf_example ( @param1 integer ) 
returns @outputTable table ( col1 int ,col2 int )
as BEGIN
  insert into \[@outputTable\] select @param1,2
end
select * from tvf_example(10248) as xxx