Hi,
this below query is create the table. i want move the records for this table from another table.
declare @columns nvarchar(max)
set @columns='['+'ID'+'] Mem_ID,'+ '['+'RefID'+'] int,'
select @columns = @columns+
'['+COALESCE( replace(cond,'_sys_defined',''),' ,')+'] datetime,'
from Condition
where idt=23
select @columns='create table idt_23('+SUBSTRING(@columns, 1, LEN(@columns) - 1)+')'
exec sp_executeSql @columns
i have another one table is there. table name is test
select * from test id=23 . this reslt is moved to the idt_23 table.
but number of column is different source and destination table.
source is 300 columns, destination is my be 50 columns.
Regards,
Abdul Khadir.M