How can I using only mysql commands create a copy of a procedure on targetDB from sourceDB? For example, the following code copies a table from SourceDB to TargetDB:
CREATE TABLE targetDB.table1 like sourceDB.table2;
INSERT INTO targetDB.table1 SELECT * FROM DB1.table1 ;
I'd like to create code that accomplishes the same thing with Views and Procedures from sourceDB to targetDB.
For views I've tried this, however I'm unsure of whether the view retains the definition/data from the source:
CREATE VIEW targetDB.view1 as SELECT * FROM sourceDB.view1;
I've tried similar things for procedures
CREATE PROCEDURE targetDB.proc1 as SELECT * from sourceDB.proc1;"
Note: I do not have access to SQL Server Management Studio for the mysql server I am working with