0

I've only seen questions where to create just the database from workbench for MYSQL.

on SQL SERVER we can create the table script and with all the inserts with all the data.

is there a way I can't do it on mysql workbench?

a table got dropped from an environment by mistake, and I'm trying to grab the same table from the other environment.

I'm did everything I could but for now I just can select * and copy the data on excel and prepare all the "INSERT INTO..."

asked Nov 24, 2021 at 16:20

1 Answer 1

-1

@RacerSQL, I didn't quite get your question but I've tried on my understanding let me know if this answer your question or not.

SET group_concat_max_len = 15000;
select 
concat ("insert into ","myTable(", group_concat( distinct column_name),") values (", "select ",group_concat(distinct column_name)," from TableName",")") AS DemoQuery
from information_schema.columns 
where table_name = 'TableName'

Before this query you can generate a create table script and after that you can execute this one

answered Nov 30, 2021 at 5:54

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.