create function getrandstr(@n int) returns varchar(max) as begin declare @k varchar(max) if(@n>10) set @k = 100 else set @k = 200 return @k end
return result set
Create function [dbo].[sf_get_customer_level_info] ( @customer_id int ) returns @TempTable table (customer_id int,scores int) as begin --Get the level of points to which the customer belongs insert into @TempTable select customer_id ,scores from customer(@cust_score) return end GO