sql2000存储过程传递函数的问题
有这么一段程序:
use pubs
go
if exists(select name from sysobjects
where name = 'titles_sum' and type ='p')
drop procedure titles_sum
go
use pubs
go
create procedure titles_sum @title varchar(40)='%',@sum money output
as
select 'title name'=title
from titles
where title like @title
select @sum=sum(price)
from titles
where title like @title
go
declare @titlecost money
execute titles_sum 'the%',@totalcost output
if @totalcost<200
begin
print ' '
print 'all of these titles can be purchased for less than $200.'
end
else
select 'the total cost of these titles is $'+rtrim (@totalcost as
varchar(20)))
大虾能帮我详细解释一下这个程序吗