获取表的字段的存储过程

CREATE proc getTable (@tabl varchar(360))
as
begin
declare @Str varchar(360)
set @Str=''
select @Str=@Str+[name]+',' from syscolumns where id=object_id(@tabl) order by colid
set @Str = substring(@Str,0,len(@Str))
print @Str
end

GO

你可能感兴趣的:(存储过程)