I have two tables Control1 (BatchID ,TableName)
, Control2(BatchID, MemID)
and there are additional tables that will be added to the database one by one. The format for the tablename is ABC_date
for example ABC_01032014
(dynamic)
Now this Table ABC_Date has one caolumn Called MemID
.
control1
and control2
are empty tables and abc_date
is populated with let's say 10 MemIds
.
So, I want to populate control1
and control2
. Control1
would have a unique ID and
tableName = ABC_date
DONE
control2
would have the same BatchID
as control1
and all 10 memIds
from ABC_Date
. Please help with control2
.
Now it should have all 10 memIDs
from ABC_Date
and 1 same batchID
from control1
Thanks