how to insert data from a table in SQL server into another table in MySQL db [duplicate] - mysql

This question already has an answer here:
Inserting from MS SQL Server to MySQL database
(1 answer)
Closed 5 years ago.
I've created a website with CMS magento2 and I'm working with a MySQL database. now I need to connect it with SAP database which is a SQL Server DB. my question is how to insert data from a table in SQL server into another table in MySQL DB?

You need to use a linked server.
This question was already answered here: Inserting from MS SQL Server to MySQL database

You have two options:
You can create a restful API that receives the serialized data from one db and formats the data before pushing the data down to the db you want to use. The good thing about it is you can easily share data between the 2 DBs without having to worry. Quite flexible because the tables can be identical or not depending on what you need.
You can use the SIS ( Server Integration Services) tool present in the SQL Server that allows integrations into other database systems. It is a bit technical but here are a few steps you can follow on link to explain the integration of SIS packages with MySQL.

Related

Recreate MySQL database in SQLite [duplicate]

This question already has answers here:
Export a MySQL Database to SQLite Database
(8 answers)
Closed 7 years ago.
I have a MySQL database that I would like in SQLite for an app I'm planning to develop. How would I go about this? Thanks.
I saw the previous question Export a MySQL Database to SQLite Database
However, there was no accepted or definitive solution. So what would be the best approach to doing this?
OK, my solution: (hope somebody finds this useful)
Installed DB Browser for SQLite from http://sqlitebrowser.org/
I exported the MySQL structure (without data) as SQL.
Then cleaned up the SQL according to this link
http://livecode.byu.edu/database/mysql-sqliteExport.php
Then in DB Browser for SQLite imported the cleaned up SQL to create the database and all the tables. I found that DB Browser for SQLite didn't allow importing of CSV data into the already created tables. So I went to the Apple App Store on my Mac and bought and installed SQLPro for SQLite app ($12 Australian...).
In SQLPro for SQLite I opened the SQLite database created in DB
Browser for SQLite.Then exported each MySQL table as CSV and
imported those into each existing table in SQLPro for SQLite.
Done
Although I've only used sqlite in an Android environment, I would recommend looking over the following:
Documentation and examples
Step-by-step example of usage
SQLite vs MySQL vs PostgreSQL
Keep in mind that sqlite is a stripped-down version of mysql and has a lot of features missing. For example, while altering an table you may only rename or add new columns, but you may not delete the existing columns. Have a look at the documentation for more specific details that may apply to your specific implementation.
You may find all the limitations here: Sqlite limitations

Migrate data from oracle to mysql [duplicate]

This question already has answers here:
Migrate from Oracle to MySQL
(7 answers)
Closed 8 years ago.
We are doing data migration from oracle to mysql using etl tool where source and target are in different hosts.
During fail over of the source we are set to do data migration with dump export/import.
Is there any way to import oracle dump directly into MYSQL without third party tools?
If its possible please explain a feasible soultion
Oracle import/export is designed to move databases/data between Oracle databases ideally of the same version, so no - this isn't an appropriate solution. Depending on the size and complexity of your database you could do it with scripts - sqldeveloper/modeller (free oracle tools) should help with this if you don't know how to do it yourself. I think sqlmodeller may allow you to generate a schema for another database (you can do it for sqlserver). The main thing to overcome is syntax differences between oracle and mysql as well as differences in datatypes - if you have been consistent in your oracle db design it should be fairly easy to overcome these with find/replace
http://www.oracle.com/technetwork/developer-tools/datamodeler/overview/index.html?ssSourceSiteId=otnru

Query SQL Server database from MySql?

I am trying to find a work around to expedite our contractors work on our new website. The website is being created in WP using MySql, and some data that the website will dynamically load is located on our business SQL Server. Migration is out of the question.
Is there a way to query our SQL server from the MySql database?
Querying SQL server from MySQL database is not the good solution I think. Why not querying the SQL server using PHP for example?
The end result was that the workaround involved adding to an internal web app to populate the MySQL database with the data that we needed

How to make a simple API from AS400+DB2 IBM in order to sync data with an external website+mysql? [duplicate]

This question already has an answer here:
Closed 11 years ago.
Possible Duplicate:
Is possible to create a cron-job on a as400 system (IBM) in order to update/insert large quantity of data on online server?
I have an AS400 system using DB2 on IBM Series and I would need to sync this data with another database that is hosted on another domain for a website.
We have all the articles on the AS400 system and I would like to update the stock in the website. It should be the most accurate possible and automatic too.
RPG can make use of JDBC. So you can write a RPG/Java program that can sync with the MySQL.

How to export data from SQL Server 2005 to MySQL [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I've been banging my head against SQL Server 2005 trying to get a lot of data out. I've been given a database with nearly 300 tables in it and I need to turn this into a MySQL database. My first call was to use bcp but unfortunately it doesn't produce valid CSV - strings aren't encapsulated, so you can't deal with any row that has a string with a comma in it (or whatever you use as a delimiter) and I would still have to hand write all of the create table statements, as obviously CSV doesn't tell you anything about the data types.
What would be better is if there was some tool that could connect to both SQL Server and MySQL, then do a copy. You lose views, stored procedures, trigger, etc, but it isn't hard to copy a table that only uses base types from one DB to another... is it?
Does anybody know of such a tool? I don't mind how many assumptions it makes or what simplifications occur, as long as it supports integer, float, datetime and string. I have to do a lot of pruning, normalising, etc. anyway so I don't care about keeping keys, relationships or anything like that, but I need the initial set of data in fast!
The best way that I have found is the MySQL Migration Toolkit provided by MySQL. I have used it successfully for some large migration projects.
Using MSSQL Management Studio i've transitioned tables with the MySQL OLE DB. Right click on your database and go to "Tasks->Export Data" from there you can specify a MsSQL OLE DB source, the MySQL OLE DB source and create the column mappings between the two data sources.
You'll most likely want to setup the database and tables in advance on the MySQL destination (the export will want to create the tables automatically, but this often results in failure). You can quickly create the tables in MySQL using the "Tasks->Generate Scripts" by right clicking on the database. Once your creation scripts are generated you'll need to step through and search/replace for keywords and types that exist in MSSQL to MYSQL.
Of course you could also backup the database like normal and find a utility which will restore the MSSQL backup on MYSQL. I'm not sure if one exists however.
SQL Server 2005 "Standard", "Developer" and "Enterprise" editions have SSIS, which replaced DTS from SQL server 2000. SSIS has a built-in connection to its own DB, and you can find a connection that someone else has written for MySQL. Here is one example. Once you have your connections, you should be able to create an SSIS package that moves data between the two.
I ddin't have to move data from SQLServer to MySQL, but I imagine that once the MySQL connection is installed, it works the same as moving data between two SQLServer DBs, which is pretty straight forward.
Rolling your own PHP solution will certainly work though I'm not sure if there is a good way to automatically duplicate the schema from one DB to the other (maybe this was your question).
If you are just copying data, and/or you need custom code anyway to convert between modified schemas between the two DB's, I would recommend using PHP 5.2+ and the PDO libraries. You'll be able to connect using PDO ODBC (and use MSSQL drivers). I had a lot of problems getting large text fields and multi-byte characters from MSSQL into PHP using other libraries.
Another tool to try would be the SQLMaestro suite. It is a little tricky nailing down the precise tool, but they have a variety of tools, both free and for purchase that handle a wide variety of tasks for multiple database platforms. I'd suggest trying the Data Wizard tool first for MySQL, since I believe that will have the proper "import" tool you need.