1. 程式人生 > >取表字段SQL

取表字段SQL

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

select @Col + ')'