Link to home
Start Free TrialLog in
Avatar of SAbboushi
SAbboushiFlag for United States of America

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
ASKER CERTIFIED SOLUTION
Avatar of Umesh
Umesh
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SAbboushi

ASKER

Nice - from what I can tell:

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??
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