Forum Replies Created
-
AuthorPosts
-
PerFredlundMember
Hi 🙂
No, im not trying to merge or union any data. I just wanted to copy tables and stored procedures from one database to another on the same MySQL instance.
What exactly does 'drop table if exists in target' do? Will it overwrite that table (structure and data) or does it mean that it is simply skipping to copy that table ?
I am still of the opinion that SQLyog should query if any table(s) of same name exists on the target database. This can be easily done before submitting the whole 'batch job' to MySQL ? Agree ? Actually this check can be done while selecting tables to be copied and mark those tables with an asterisk or something. I agree that is the user responsibility to check duplicate table names, but it's nice if SQLyog automatically can do this check also. I can't see that transactions come into play if done like i already stated 😕
Ok, as a sidetrack to this thread …
I want to create a stored procedure where i first do a select query. Then i want to perform some action on each tuple in the resulting set of tuples. I can't find anywhere how this is easily done in MySQL.
Thanx for all help,
-Per 😎
PerFredlundMemberHi again 🙂
Have attached the file u asked for. U should make the test2 database contain the table kurstilbyder already. Incidentally that table has a different structure from the table kurstilbyder in the source database 😕
Maybe this whole issue arose from the fact that the table w same name – kurstilbyder – but different structure existed in both databases ??
Kind regards,
-Per
Hi <_< To add to the confusion i tried again the same operation just now. No tables at all were being copied, got the same message about duplicate table name. This time the stored procedures got copied to the target database however, and were not deleted in the source database. This is a much better outcome. But i think the copy operation should at least give me an option to cancel my operation or at the very least copy over those tables that do not exist in the target database … :huh: -Per
PerFredlundMemberHey again!
OK, more details 🙂
I have attached the settings and tablenames etc in the attached pictures/files. The copying was from one database to another database on the same server : Windows Server 2003 SP 1.
MySQL version = 5.0.18
SQLyog version = 5.13 (free edition)
Luckily the leksjon (source database) was only a development-database and not a production-database 😮 Even i selected to copy table-data as well all tables were empty.
Best regards,
-Per
PerFredlundMemberHey !
Ok, i will supply more details about what i did. I didn't get any other error message than some message about duplicate table in the target database.
Ok what i did was this :
In the SQLyog problem left pan i highlighted one of the databases. Then i chose Copy database to different Host/DB. I selected all tables in the Source Database. And i selected the correct Target Database. And i checked the box to copy Stored Procedures as well. Then i clicked the Copy button. Soon after i got that message about duplicate table names. I did not check drop table if exists in target database. And i did not change the deafult option of copying both structure and data. I wanted the data to be copied over to the other database as well. When i got the message about duplicate table names i clicked ok, and was hoping the rest of the tables and stored procedures would be copied over. But that was not the case. Not all tables were copied over. And no stored procedures were copied over either. The really bad thing was that all stored procedures were gone from the source database 🙁 I do not have any dumps or screenshots of the incidence 😮
I could have accepted that the copying process failed. It was my fault that i had duplicate table names in the 2 databases. But it's really not my fault that the stored procedures had been dropped from the source database since i was only performing a copy operation.
Hope that this information was helpful 🙂
Best regards,
-Per
-
AuthorPosts