|
create table T(a int, b int, c int, d int)
insert T select 1, 1, 1,1
declare @sql varchar(8000)
set @sql='select '
select @sql=@sql+name+'_fw='+name+',' from syscolumns where id=object_id('T')
order by colid
select @sql=left(@sql, len(@sql)-1), @sql=@sql+' from T'
--print @sql
exec(@sql)
--result
a_fw b_fw c_fw d_fw
----------- ----------- ----------- -----------
1 1 1 1 |
|