I have a need to create a table valued function in SQL Server. The function has input parameters, but all of them have default values. If I want to SELECT from the function using default values for every input parameter, I cannot figure out how to call the function.
Below is the CREATE FUNCTION as well as my four attempts to call it without providing input-parameter values. All four attempts failed:
CREATE FUNCTION fx_my_table_valued_function
(@my_input_parameter AS VARCHAR(30) = 1)
RETURNS TABLE
RETURN SELECT 'x' AS my_column;
select * from fx_my_table_valued_function;
select * from fx_my_table_valued_function();
select * from [fx_my_table_valued_function];
select * from [fx_my_table_valued_function]();
Thanks in advance for any help.