Click here to Skip to main content
15,888,096 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
how to execute a user defined function or we cannot able to execute the user defined function.
Posted

You can execute the function as follows:

Create the function..
SQL
Create function Test(@i int)
returns int
as
begin
  return @i+2
end

calling the function:
select dbo.Test(2);


If your function returns table, then you can also query as:
select * from dbo.function_name()
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900