forums › forums › SQLyog › Sync tools, Migration, Scheduled Backup and Notifications › Truncate Before Import
- This topic is empty.
-
AuthorPosts
-
-
January 11, 2011 at 7:53 pm #12225Ben WilsonMember
I'm using “Import External Data” to import from an ODBC source.
Is there a way to TRUNCATE a table before import? I checked under the transform “Advanced” options and maybe I'm just not seeing it (or looking in the right place). I would think it would be in the “Table Creation” or “Copy Data” section.
-
January 11, 2011 at 11:12 pm #31814peterlaursenParticipant
No option to TRUNCATE .. but to DROP TABLE before import.
If you want to TRUNCATE (if for some reason DROP+(RE)CREATE TABLE has some issue) you may create a batch job of 2 SJA jobs
1) a notifications service job executing TRUNCATE TABLE.
2) a import job importing to the now empty table
FAQ links:
http://www.webyog.com/faq/content/27/114/en/introduction-to-the-_sqlyog-job-agent_-sja.html
-
January 12, 2011 at 3:36 pm #31815Ben WilsonMember
Thanks Peter.
Using the auto generated table, DROP + (re)CREATE won't work in my case. The (MSSQL) table I'm exporting from has differences in type, indexes and a custom function as default for one of the columns.
This brings me to my next question. I'm guessing it will, but under transform “Map” options, will SQLyog save the “Edit SQL” custom table creation data? Will a custom CREATE have an impact on import field mapping?
-
January 13, 2011 at 12:00 pm #31816peterlaursenParticipant
If I understand the question, the answer is that everything you have defined in the wizard will be saved in the job file if you choose to save a job file (but not if you choose 'execute now' without saving).
So I do not see why you cannot DROP + (RE)CREATE the table(s). If you execute from the wizard then use the option to 'open existing jobfile'.
-
January 19, 2011 at 6:52 pm #31817peterlaursenParticipant
Added to our issue tracker here: http://code.google.com/p/sqlyog/issues/detail?id=1598
The request makes good sense when you are importing to an existing table with data and don't have a jobfile with details stored with column mappings for the job.
-
-
AuthorPosts
- You must be logged in to reply to this topic.