Store procedure to createa new table with existing table structure
deekayAug 19 2010 — edited Aug 19 2010Hi All,
THis is what I want to achieve,
I want to create procedure which will take a input parameter as name of a table lets say 'EMP',
and this procedure will check whether that table exist or not?
if exist then
it will create a new table with name appending _dummy to existing table name (ex: new table will be EMP_DUMMY) ,
and new table should have the same table structure ,index and constraint imposed on EMP table.
NB: It should not be created using as select like create table EMP_DUMMY as select * from EMP where condition=false;
Can any one please help me how to achieve this?
Thanks,
Deekay