1 ALTER function [dbo].[获取字段名](@字段名 varchar(max)) 2 returns varchar(max) 3 as 4 begin 5 declare @colname varchar(max) 6 select @colname=coalesce(@colname +',','') +b.name from sysobjects a join syscolumns b on a.id=b.id where a.id=object_id(@字段名) order by b.colorder 7 return @colname 8 end
标签:varchar,max,colname,获取,id,字段名 From: https://www.cnblogs.com/ljtao/p/17630545.html