Fengzhimei@Dot.Net
Designing My Colorful Dream
posts - 77,  comments - 196,  trackbacks - 3
    I have a following Question to ask all of you:

    Suppose you have a table named tblRoles with column named "RoleName". Now, construct a query that will select all the role names into a single varchar with commas, what will you do?

DECLARE @RoleName VARCHAR(8000)
SET @RoleName = ''
SELECT @RoleName = RoleName + ',' + @RoleName
FROM tblRoles
posted on 2004-07-04 14:55 fengzhimei 阅读(1743) 评论(2) 编辑 收藏