Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have done with creation of dynamically created tables at runtime. But now I need to enter the data from these tables to other tables. When data comes into these tables just need to put into another tables. Please provide a suggestion, how I can accomplish my task.

Do I use cron jobs to fire triggers or storeprocedures but tables are dynamicall generated from data being sent to other tables that alreay existised?

Thanks,
Sahil
Posted

1 solution

there are ways to do that:
one of them could be using Trigger like the following

SQL
CREATE TRIGGER tbl1_after_insertT ON tbl1 AFTER insert as
BEGIN

    INSERT into tbl2(id, CODE, NAME)
        select id,CODE,NAME  FROM
        INSERTED

END


another one could be using replication, in your case if the tables are being created dynamically, it is very hard to set it up. but it's still an option
 
Share this answer
 
Comments
SahilKataria 21-Jun-14 1:27am    
thanks for your response, I already did that. But my tables are dynamically created with dynamic name everytime. So I want to do with taht way. Can you please suggest the way accordingly or provide some replication links or other way like do I use cron jobs?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900