SAbboushi
asked on
Procedure to create multiple tables using other table definitions
I have a schema that has 'DB1' with several tables
I need someone to sketch out a procedure / script that will create a new schema using a user defined variable (@DBname) and then create empty tables in @DBname using the table definitions from DB1.
I want something automated where only @DBname needs to be specified. Anyone know how to do that?
With Regards-
Sam
I need someone to sketch out a procedure / script that will create a new schema using a user defined variable (@DBname) and then create empty tables in @DBname using the table definitions from DB1.
I want something automated where only @DBname needs to be specified. Anyone know how to do that?
With Regards-
Sam
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi!!
updated version of stored procedure is avail on below url
http://ushastry.blogspot.com/2010/01/mysql-copy-tables-only-structure-and-no.html
Regards,
Umesh
updated version of stored procedure is avail on below url
http://ushastry.blogspot.com/2010/01/mysql-copy-tables-only-structure-and-no.html
Regards,
Umesh
ASKER
This creates a record in the mysql.proc table that will remain there until deleted?
How do I EDIT the stored procedure? the body_utf8 field is empty... I thought it would contain the procedure code??