forums › forums › SQLyog › Using SQLyog › Importing Into Column From Csv
- This topic is empty.
-
AuthorPosts
-
-
June 30, 2010 at 3:02 pm #12021Mike SMember
Good morning everyone!
I have a messageboard that has a Microsoft SQL 2000 database, and I am bringing that into vBulletin, which is MySQL.
The problem I am having is bringing in thread titles.
The MSSQL and MySQL columns are both varchar(250), when I use SQLyog to import “Subject” from cs_Posts into the “title” column of the “thread” table, it says it completes successfully but when I go into the data, the entire thread column is blank, as of nothing imported at all.
I exported to a CSV next, then used the Import utility in SQL to bring in the CSV file to the “title” column to get my thread titles imported, but the issue I am having now, is it imports, but it appears to create new rows, not update existing.
I want to update the existing rows starting with the first one and match the CSV to the rows from top to bottom.
Please help!!!!
-
June 30, 2010 at 3:43 pm #31017Sayan ChalihaMember
Hey Mike,
This forum is for queries pertaining to MONyog — MySQL Monitor. I'm sure you meant to post in one of the SQLyog forums… so let me just move the post for you, and I'm sure somebody will reply to your query at the earliest.
-
July 1, 2010 at 6:06 am #31018KhushbooMember
Hi Mike,
Quote:The MSSQL and MySQL columns are both varchar(250), when I use SQLyog to import “Subject” from cs_Posts into the “title” column of the “thread” table, it says it completes successfully but when I go into the data, the entire thread column is blank, as of nothing imported at all.When import job completes, wizard shows how many rows are transfered, please check if it shows 0 rows transferred.
Also, please check what option you have selected in Import External Data –> Advanced Options?
(see the screenshots)
Quote:I exported to a CSV next, then used the Import utility in SQL to bring in the CSV file to the “title” column to get my thread titles imported, but the issue I am having now, is it imports, but it appears to create new rows, not update existing.Please use “Import into existing table” and “Update with source details” options in Import External Data –> Advanced options.
Thank You.
Regards,
Khushboo
-
July 1, 2010 at 2:02 pm #31019Mike SMember'Khushboo' wrote on '01:
Hi Mike,
When import job completes, wizard shows how many rows are transfered, please check if it shows 0 rows transferred.
Also, please check what option you have selected in Import External Data –> Advanced Options?
(see the screenshots)
Please use “Import into existing table” and “Update with source details” options in Import External Data –> Advanced options.
Thank You.
Regards,
Khushboo
Thank you for the reply, Khushboo.
But, I am using those options and it still puts new rows onto the end where the last row is (aka not updating, just creating)
Unfortunately I can't use the “Drop and recreate” option because it deletes all the columns in the thread table except for the title column.
-
July 2, 2010 at 4:34 am #31020KhushbooMember
Hi Mike,
Please check if your table created at target has a primary key?
If the table does not have primary key, new rows will added at end but if it has then existing rows will be updated.
So in your case, table should have a primary key to update existing table.
You can send us the create table structure if the issue persist.
Thank & Regards,
Khushboo
-
-
AuthorPosts
- You must be logged in to reply to this topic.