Fengzhimei@Dot.Net
Designing My Colorful Dream
    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  阅读(1931)  评论(2编辑  收藏  举报