So basically I have a table that looks like this. I have to migrate data from source database tables to its corresponding target database tables.
SourceTableName DenormalizedU4SMTable TargetTableName
1) Lookup_AcademicTimeType Time ACTimeType
2) Lookup_TimeDurationType Time ACTimeDurationType
3) TimeStructure_ACAcademicTime Time ACAcademicTime
4) TimeStructure_AdmissionsTime Time AdmissionsTime
5) TimeStructure_BillingTime Time BillingTime
Now i want to iterate through each row of this table in such a way that so I can copy the data from Lookup_AcademicTimeType to ACTimeType. So the target database tables have some extra columns like Create Date, ModifyDate, etc.
INSERT INTO TARGET_TABLE (HERE I WANT TO AUTOMATICALLY BRING ALL COLUMN OF SPECIFIC TARGET TABLE)
SELECT *, **THOSE EXTRA COLUMN**
FROM SOURCE_TABLE
I can do this one by one for each table but i want to do this dynamically for all the tables in one go. Can anyone tell me how i can do this??