--编写一个自定义函数,能够实现参数化查询的功能。
--根据输入的商品编号,返回其对应商品的名称,类别,单价,库存量及同类商品的类似信息
--数据类型都是匹配的,且函数创建成功,可检验时会出错,觉着是对的呀
create function sp_ifo(@sp_id char(10)) 
returns @sp_infor table(sp_name char(20)null,sp_type2 char(20)null,sp_dj money)
as
begin
declare @sp_name char(20),@sp_type char(20),@sp_dj money
select @sp_name=sp_name ,@sp_type=sp_type2, @sp_dj=sp_dj from dbo.sp where sp_id=@sp_idinsert @sp_infor 
values(@sp_name ,@sp_type ,@sp_dj )
return
end
select dbo.sp_ifo('000002')提示错误:找不到列 "dbo" 或用户定义的函数或聚合 "dbo.sp_ifo",或者名称不明确。