Click here to Skip to main content
15,891,674 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hii to all
i want to get or copy tables data present in remote server, from or to my local database,preferrably by writing procedures or triggers.For example there is a table called emp2 in database called db2 present in different server at some x location.I want to get,copy this emp2 tables data from my local database called db1 to the table called emp1.Simply how can i perform all database operations by communicating with same are different kind of dtabases(sqlserver and mysql or any two)present in different locations by writing procedures and triggers.Please help me how can i go with this...thanx in advance
Posted
Updated 21-Feb-13 1:36am
v2
Comments
CHill60 21-Feb-13 7:24am    
Have a look at the solution to this question - haven't posted it as a solution (yet) as it's similar to what you need but worded differently
http://www.codeproject.com/Answers/541402/SynchronizationplusInplusSqlplusServer#answer1

1 solution

There are several ways you can do this.

1. Use linked server to connect the remote server.
2. Use distributed query in sql server like OPENROWSET For example

SQL
SELECT a.* INTO dbo.TestDepartment
FROM OPENROWSET('SQLNCLI', 'Server=Seattle1;Trusted_Connection=yes;',
     'SELECT GroupName, Name, DepartmentID
      FROM AdventureWorks2012.HumanResources.Department
      ORDER BY GroupName, Name') AS a;


For more information have a look on:
http://msdn.microsoft.com/en-us/library/ms190312.aspx[^]
 
Share this answer
 
Comments
Ram7 from Hyderabad 22-Feb-13 1:04am    
hii Khorshed thanks for ur responce,i have tried with linked server,but i didn't reached my requirement.Iam getting error with connection.can u also please guide me how to work on linked server or to provide any link to go with this.Iam trying to create linked server to mysql db from sqlserver db.............
Khorshed Alam, Dhaka 22-Feb-13 1:12am    
Dear Ram7,
Please have a look on the link, it may help you.
http://www.ideaexcursion.com/2009/02/25/howto-setup-sql-server-linked-server-to-mysql/
Ram7 from Hyderabad 22-Feb-13 1:22am    
Thanks a lot khorshed, i will go with
this.......

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