DECLARE @resultstr VARCHAR(8000)
SET @resultstr=''
SELECT @resultstr=@resultstr+'|'+[BaseImage] FROM dbo.life_fc
PRINT @resultstr
示例2
DECLARE @imgColleciton VARCHAR(8000),@BaseID INT,@value VARCHAR(5000),@citcode VARCHAR(100),@type VARCHAR(100)
SET @imgColleciton=''
SELECT @citcode=BaseCityCode FROM dbo.life_fc
SELECT @type= BaseTypeID FROM dbo.life_fc
SELECT @imgColleciton=@imgColleciton+'|'+[BaseImage] FROM dbo.life_fc
SELECT 'E:\cityresource7\cn\'+@citcode+'\zh-chs\etongcheng\'+cast(@type as varchar(8))+'\img'+value FROM [dbo].[SplitString](@imgColleciton,'|',0)