Hi,
i need how to create tables dynamically using while loop.
this below query is created for one table but i need dynamically.
declare @columns nvarchar(max)
set @columns='['+'MemberID'+'] Mem_ID,'+ '['+'RefID'+'] int,'
select @columns = @columns+
'['+COALESCE( replace(conditionname,'_sys_defined',''),' ,')+'] datetime,'
from Condition
where GrpID=23
select @columns='create table Dise_23('+SUBSTRING(@columns, 1, LEN(@columns) - 1)+')'
exec sp_executeSql @columns
how to change this query for dynamic table creation using while loop.
here create the dynamic table is based on GrpID.
please modify this query...
Regards,
Abdul Khadir.M