MySQL Backup Table if it Exists

Rudde

New Member
I am trying to write a script that will copy all the data in table a to table b if table a exists. Table b is the exact same structure as table a would be if it exists, though it may not. I am able to copy using the following statement: \[code\]INSERT INTO 'B' SELECT * FROM 'A'\[/code\], but I don't know where to use \[code\]IF EXISTS\[/code\], or if I even can to determine if I an perform the insertion. I am trying to do this in SQL only as it will be run through as a .sql script from the command line.
 
Top