declare @e varchar(8000)
select @e=''
select @e = @e+'case when isnumeric(['''+name+'''])=1 then '+name+' else null end ,'
from syscolumns where id=object_id('table')if len(@e) >0
select @e=substring(@e,1,len(@e)-1)print @e
select @e=''
select @e = @e+'case when isnumeric(['''+name+'''])=1 then '+name+' else null end ,'
from syscolumns where id=object_id('table')if len(@e) >0
select @e=substring(@e,1,len(@e)-1)print @e
select @e=''
select @e = @e+'case when isnumeric(['+name+'])=1 then ['+name+'] else null end ,'
from syscolumns where id=object_id('table')if len(@e) >0
select @e=substring(@e,1,len(@e)-1)print @e
declare @t sysname
declare #c cursor for select name from syscolumns where id=object_id('table')
open #c
fetch next from #c into @t
while @@fetch_status=0
begin
print @t
fetch next from #c into @t
end
close #c
deallocate #c