The code tries to get all numeric columns and then returns the list as a new table but I am getting stuck at the begin
part. The error is: Expecting EXTERNAL near 'begin'.
go
create function get_num_col(@table_name varchar(255))
returns table ( column_name varchar(255) )
as
begin
select
column_name
from INFORMATION_SCHEMA.columns
where TABLE_NAME = table_name
and data_type in ('NUMBER', 'FLOAT', 'DOUBLE')
return
end