日期:2014-05-17 浏览次数:20602 次
create function testFunc(@standards varchar(100))
returns varchar(8000)
as
begin
declare @re varchar(500)
set @re = ''
select @re = @re+','+Reason
from tb
where @standards=standards
return (stuff(@re,1,1,''))
end
create proc proc_test (@standards varchar(100))
as
set nocount on
declare @re varchar(500)
set @re = ''
select @re = @re+','+Reason
from tb
where @standards=standards -->不知道@standards你传进来什么值?不同的值这个条件表达式会不一样
select stuff(@re,1,1,'')
go