How to move data from SQL Server to MySQL databaseHow to scale when database gets huge?Push Data from MySQL...
If I tried and failed to start my own business, how do I apply for a job without job experience?
In the Lost in Space intro why was Dr. Smith actor listed as a special guest star?
Did ancient Germans take pride in leaving the land untouched?
Is there redundancy between a US Passport Card and an Enhanced Driver's License?
Is the UK legally prevented from having another referendum on Brexit?
How do I make my single-minded character more interested in the main story?
What really causes series inductance of capacitors?
Will the duration of traveling to Ceres using the same tech developed for going to Mars be proportional to the distance to go to Mars or not?
What is an efficient way to digitize a family photo collection?
Why do single electrical receptacles exist?
Two oatmeal pies a day keep the doctor away?
Protagonist constantly has to have long words explained to her. Will this get tedious?
Was the Spartan by Mimic Systems a real product?
What does "south of due west" mean?
How can I differentiate duration vs starting time
What is formjacking?
Why would you use 2 alternate layout buttons instead of 1, when only one can be selected at once
Does an enchantment ability that gives -1/-1 to opponent creatures resolve before other abilities can be used on a 1/1 entering the battlefield
Can someone explain what a key is?
Why is it that Bernie Sanders is always called a "socialist"?
When does a person lose diplomatic status?
How do I purchase a drop bar bike that will be converted to flat bar?
My job requires me to shuck oysters
Question Tag error
How to move data from SQL Server to MySQL database
How to scale when database gets huge?Push Data from MySQL to SQL ServerTrying to recover/import/transfer database from MySQL data dirHow to efficiently swap a portion of a large table's data?Copy table form MS-SQL server to MySQL, is it possible?MySQL - Move data between partitions aka re-partitionFastest Way to Move Data from Current Database for Multiple Tables to New Database?I want to Move some Mysql table to InnoDB but i don't know what is the best my.cnf confWhat happens if a delete query times out SQL Server for php?Deleting data from a table containing LOBs did not reduce the amount of data reported INTERNALLY by the table or database
Our MSSQL
database has a table that has about 4 million rows of data. My original plan was to copy it over to a MySQL
database and place it in a more optimized format.
For some reason, the people setting this table up assumed that the user was going to be adding and removing codes. But in reality, the codes A, B, C, etc.
would never be removed or added.
The MSSQL Setup:
+------+------+-------+
| Part | Code | Price |
+------+------+-------+
| E123 | A | 12.20 |
+------+------+-------+
| E123 | B | 15.20 |
+------+------+-------+
| R77 | A | 11.75 |
+------+------+-------+
| R77 | B | 12.75 |
+------+------+-------+
The MySQL Setup:
+------+-------+-------+
| Part | A | B |
+------+-------+-------+
| E123 | 12.20 | 15.20 |
+------+-------+-------+
| R77 | 11.75 | 12.75 |
+------+-------+-------+
This setup should significantly reduce the rows.
Would the best way to do this is to copy the MSSQL
into a temporary MySQL
table and then have PHP move the data to a new table with the new format?
sql-server mysql
bumped to the homepage by Community♦ 12 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
Our MSSQL
database has a table that has about 4 million rows of data. My original plan was to copy it over to a MySQL
database and place it in a more optimized format.
For some reason, the people setting this table up assumed that the user was going to be adding and removing codes. But in reality, the codes A, B, C, etc.
would never be removed or added.
The MSSQL Setup:
+------+------+-------+
| Part | Code | Price |
+------+------+-------+
| E123 | A | 12.20 |
+------+------+-------+
| E123 | B | 15.20 |
+------+------+-------+
| R77 | A | 11.75 |
+------+------+-------+
| R77 | B | 12.75 |
+------+------+-------+
The MySQL Setup:
+------+-------+-------+
| Part | A | B |
+------+-------+-------+
| E123 | 12.20 | 15.20 |
+------+-------+-------+
| R77 | 11.75 | 12.75 |
+------+-------+-------+
This setup should significantly reduce the rows.
Would the best way to do this is to copy the MSSQL
into a temporary MySQL
table and then have PHP move the data to a new table with the new format?
sql-server mysql
bumped to the homepage by Community♦ 12 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
2
Just FYI 4 million <> "big"
– Aaron Bertrand♦
Nov 26 '14 at 15:14
1
You canPIVOT
the SQL Server table to give you the correct structure for MySQL. I don't think you need PHP at any point.
– Mark Sinkinson
Nov 26 '14 at 15:15
3
I find the first design preferable to the 2nd one.
– ypercubeᵀᴹ
Nov 26 '14 at 15:33
add a comment |
Our MSSQL
database has a table that has about 4 million rows of data. My original plan was to copy it over to a MySQL
database and place it in a more optimized format.
For some reason, the people setting this table up assumed that the user was going to be adding and removing codes. But in reality, the codes A, B, C, etc.
would never be removed or added.
The MSSQL Setup:
+------+------+-------+
| Part | Code | Price |
+------+------+-------+
| E123 | A | 12.20 |
+------+------+-------+
| E123 | B | 15.20 |
+------+------+-------+
| R77 | A | 11.75 |
+------+------+-------+
| R77 | B | 12.75 |
+------+------+-------+
The MySQL Setup:
+------+-------+-------+
| Part | A | B |
+------+-------+-------+
| E123 | 12.20 | 15.20 |
+------+-------+-------+
| R77 | 11.75 | 12.75 |
+------+-------+-------+
This setup should significantly reduce the rows.
Would the best way to do this is to copy the MSSQL
into a temporary MySQL
table and then have PHP move the data to a new table with the new format?
sql-server mysql
Our MSSQL
database has a table that has about 4 million rows of data. My original plan was to copy it over to a MySQL
database and place it in a more optimized format.
For some reason, the people setting this table up assumed that the user was going to be adding and removing codes. But in reality, the codes A, B, C, etc.
would never be removed or added.
The MSSQL Setup:
+------+------+-------+
| Part | Code | Price |
+------+------+-------+
| E123 | A | 12.20 |
+------+------+-------+
| E123 | B | 15.20 |
+------+------+-------+
| R77 | A | 11.75 |
+------+------+-------+
| R77 | B | 12.75 |
+------+------+-------+
The MySQL Setup:
+------+-------+-------+
| Part | A | B |
+------+-------+-------+
| E123 | 12.20 | 15.20 |
+------+-------+-------+
| R77 | 11.75 | 12.75 |
+------+-------+-------+
This setup should significantly reduce the rows.
Would the best way to do this is to copy the MSSQL
into a temporary MySQL
table and then have PHP move the data to a new table with the new format?
sql-server mysql
sql-server mysql
edited Nov 26 '14 at 15:39
Jared Dunham
asked Nov 26 '14 at 15:06
Jared DunhamJared Dunham
1012
1012
bumped to the homepage by Community♦ 12 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 12 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
2
Just FYI 4 million <> "big"
– Aaron Bertrand♦
Nov 26 '14 at 15:14
1
You canPIVOT
the SQL Server table to give you the correct structure for MySQL. I don't think you need PHP at any point.
– Mark Sinkinson
Nov 26 '14 at 15:15
3
I find the first design preferable to the 2nd one.
– ypercubeᵀᴹ
Nov 26 '14 at 15:33
add a comment |
2
Just FYI 4 million <> "big"
– Aaron Bertrand♦
Nov 26 '14 at 15:14
1
You canPIVOT
the SQL Server table to give you the correct structure for MySQL. I don't think you need PHP at any point.
– Mark Sinkinson
Nov 26 '14 at 15:15
3
I find the first design preferable to the 2nd one.
– ypercubeᵀᴹ
Nov 26 '14 at 15:33
2
2
Just FYI 4 million <> "big"
– Aaron Bertrand♦
Nov 26 '14 at 15:14
Just FYI 4 million <> "big"
– Aaron Bertrand♦
Nov 26 '14 at 15:14
1
1
You can
PIVOT
the SQL Server table to give you the correct structure for MySQL. I don't think you need PHP at any point.– Mark Sinkinson
Nov 26 '14 at 15:15
You can
PIVOT
the SQL Server table to give you the correct structure for MySQL. I don't think you need PHP at any point.– Mark Sinkinson
Nov 26 '14 at 15:15
3
3
I find the first design preferable to the 2nd one.
– ypercubeᵀᴹ
Nov 26 '14 at 15:33
I find the first design preferable to the 2nd one.
– ypercubeᵀᴹ
Nov 26 '14 at 15:33
add a comment |
1 Answer
1
active
oldest
votes
I developed a query and ran it through bcp and imported that to the mysql.
The BCP script used:
bcp "SELECT * FROM [Example].[dbo].[Price] pivot (max (Price) for Code in ([A], [B])) as NewCode" queryout C:testexample.txt -c -T
The MySQL Script used:
mysqlimport price /test/example.txt
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "182"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f83716%2fhow-to-move-data-from-sql-server-to-mysql-database%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I developed a query and ran it through bcp and imported that to the mysql.
The BCP script used:
bcp "SELECT * FROM [Example].[dbo].[Price] pivot (max (Price) for Code in ([A], [B])) as NewCode" queryout C:testexample.txt -c -T
The MySQL Script used:
mysqlimport price /test/example.txt
add a comment |
I developed a query and ran it through bcp and imported that to the mysql.
The BCP script used:
bcp "SELECT * FROM [Example].[dbo].[Price] pivot (max (Price) for Code in ([A], [B])) as NewCode" queryout C:testexample.txt -c -T
The MySQL Script used:
mysqlimport price /test/example.txt
add a comment |
I developed a query and ran it through bcp and imported that to the mysql.
The BCP script used:
bcp "SELECT * FROM [Example].[dbo].[Price] pivot (max (Price) for Code in ([A], [B])) as NewCode" queryout C:testexample.txt -c -T
The MySQL Script used:
mysqlimport price /test/example.txt
I developed a query and ran it through bcp and imported that to the mysql.
The BCP script used:
bcp "SELECT * FROM [Example].[dbo].[Price] pivot (max (Price) for Code in ([A], [B])) as NewCode" queryout C:testexample.txt -c -T
The MySQL Script used:
mysqlimport price /test/example.txt
answered Nov 26 '14 at 16:38
Jared DunhamJared Dunham
1012
1012
add a comment |
add a comment |
Thanks for contributing an answer to Database Administrators Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f83716%2fhow-to-move-data-from-sql-server-to-mysql-database%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
Just FYI 4 million <> "big"
– Aaron Bertrand♦
Nov 26 '14 at 15:14
1
You can
PIVOT
the SQL Server table to give you the correct structure for MySQL. I don't think you need PHP at any point.– Mark Sinkinson
Nov 26 '14 at 15:15
3
I find the first design preferable to the 2nd one.
– ypercubeᵀᴹ
Nov 26 '14 at 15:33