例:表1(A是表1的唯一字段)
A
2
3
5
7
kl
中国
要求得到字符串 A,2,3,5,7,kl,中国
写存储过程,谢了
------解决方案--------------------
declare @str varchar(8000)
set @str = ' '
select @str [email protected] + ', '+A from 表1
select stuff(@str,1,1, ' ')
------解决方案--------------------
create proc up_t1
as
declare @sql varchar(8000)
set @sql= ' '
select @[email protected]+A+ ', ' from 表1
select @sql=left(@sql,len(@sql)-1)
print @sql