获得MSSQL表中的所有列字段名称的方法(存储过程)

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

Create  Proc pAllColumnSql 
(@tableName varchar(50)) 
as 
    
Declare @Name Varchar(2000) 
set @Name =’’ 
select @Name =@Name + ’,’ + Cast([name] as Varchar) 
from syscolumns 
where id=object_id(@tableName) 
set @name = substring(@name,2,len(@name)-1) 
select @name