我写了一个存储过程...但是提示出错误.说是TugboatList是一个不可识别的函数
--------------------------------------------------------------------------
CREATE FUNCTION TugboatList (@InEmpId nvarchar(10))
RETURNS nvarchar(500)
as
begin
declare @s nvarchar(2000)
set @s=''
select @s=@s+','+TugboatName+'' from ShangJSD_Son where AccountID=@InEmpId
return stuff(@s,1,1,'')
end
GO
select *,TugboatList(AccountID) as tnb from ShangJSD_Mather order by Unid desc
GO
--------------------------------------------------------------------------
CREATE FUNCTION TugboatList (@InEmpId nvarchar(10))
RETURNS nvarchar(500)
as
begin
declare @s nvarchar(2000)
set @s=''
select @s=@s+','+TugboatName+'' from ShangJSD_Son where AccountID=@InEmpId
return stuff(@s,1,1,'')
end
GO
select *,TugboatList(AccountID) as tnb from ShangJSD_Mather order by Unid desc
GO
RETURNS nvarchar(500)
as
begin
declare @s nvarchar(2000)
set @s=''
select @s=@s+','+TugboatName+'' from ShangJSD_Son where AccountID=@InEmpId
return stuff(@s,1,1,'')
end--你创建的是函数,而不是存储过程,改为如上试试
select *,dbo.TugboatList(AccountID) as tnb from ShangJSD_Mather order by Unid desc要在函数TugboatList前加dbo.
这句肯定有问题啊。
--------------------------------------------------------------------
我怎么样才可以把上面那一部份做为存储过程来存呢.要是放在程序当中太多了.也不知道怎么样加到程序当中来用.