Hi @Mohd. Omar Daraz ,
According to your requirement, you could consider to create triggers which could insert new data from table1, table2 to table3 antomatically.
Please refer below examples:
--create triggers on both tables
CREATE TRIGGER Table1Insert ON table1
FOR INSERT
AS
INSERT INTO table3
select * FROM inserted
CREATE TRIGGER Table2Insert ON table2
FOR INSERT
AS
INSERT INTO table3
select * FROM inserted
--insert some new data in table1 and table2
insert into Table1 values
(555,'qqq','japan'),
(666,'www','china')
insert into Table2 values
(888,'ppp','london'),
(999,'ooo','france')
--query table3
select * from table3
Output:
id name city
1 a newyork
2 b washington
3 c dallas
10 x sydney
20 y melbourne
30 z queensland
666 www china
555 qqq japan
999 ooo france
888 ppp london
Best regards
Melissa
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.