if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[str1]') and xtype in (N'FN', N'IF', N'TF'))
drop function [dbo].[str1]
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
create function dbo.str1(@f_fileNo varchar(500))
returns varchar (8000)
as
begin
declare @r varchar (8000)
set @r=''
select @r=@r+' '+','+f_tgdd
from xcm_freight
where f_fileNo=@f_fileNo
return stuff(@r,1,1,'')
end
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO