取表字段SQL

declare @Col varchar(2000),@TName varchar(128) set @TName = 'D_Mzgh' set @Col = '' select @Col = @Col + ',' + name From syscolumns where id = object_id(@TName) order by colid

select substring(@Col,2,2000)

原文地址:https://www.cnblogs.com/ftian26977863/p/10252853.html