34,594
社区成员
发帖
与我相关
我的任务
分享
declare @stuTb table (uid int , stuName varchar(50))
Insert Into @stuTb
select 1,'张三'
union
select 2,'李四'
declare @a varchar(8000)
select @a=isnull(@a+',','')+stuName from @stuTb
select @a
张三,李四
(所影响的行数为 1 行)
declare @a varchar(8000)
select @a=isnull(@a+',','')+[name] from student
select @a
declare @name varchar(8000)
select @name=isnull(@name+',','')+name from syscolumns where id=object_id('sysobjects')
select @name
/*
base_schema_ver,cache,category,crdate,deltrig,ftcatid,id,indexdel,info,instrig,name,parent_obj,refdate,replinfo,schema_ver,seltrig,stats_schema_ver,status,sysstat,type,uid,updtrig,userstat,version,xtype
*/