Is it possible: insert into datatable1 select * from datatable2

Posted by Thiru under VB.NET on 8/19/2012 | Points: 10 | Views : 2352 | Status : [Member] | Replies : 3
Hi Friends,
Is it possible to do the following method in datatable

insert into datatable1 select * from datatable2

(assume both tables are same)




Responses

Posted by: Vuyiswamb on: 8/19/2012 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
it is Possible

If this is a SQL database , you can create link server from one of the server , when you create a link server you can give it a name that you can use in your queries like this


insert into datatable1
select * from Server2.dbo.datatable2 .table2


Thank you for posting at Dotnetfunda
[Administrator]

Thiru, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Thiru on: 8/19/2012 [Member] Starter | Points: 25

Up
0
Down
I cant able to understand your answer.

for your information: i am working with mysql db
is it possible to do so with mysql db ?

Thiru, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 8/19/2012 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
I am not an Expert in MySQL but i think there should be a way to do that , but in SQL its easy with Link servers

To do this with MySQL see below

http://stackoverflow.com/questions/5370970/how-to-create-linked-server-mysql

This will direct you to other links that can resolve your problem

Thank you for posting at Dotnetfunda
[Administrator]

Thiru, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response