简体   繁体   中英

How to get a column creation script workbench?

I upload my sql database on workbench to add properly a new relation between two tables. But I only need The ALTER TABLE .. ADD .. AFTER script not the CREATE TABLE because it's already created with inserted values.

So is there any solution to get the script only to create the column with its foreign keys ?

Thank you in advance.

Not sure when this function was introduced, but with workbench 5.2.33 you can obtaing the ALTER statment by selecting the table you want to alter, and right-click and select ALTER

在此处输入图片说明

After this you can define the Foreing Keys

在此处输入图片说明

And when you press "Apply", you can see and copy the script

在此处输入图片说明

Once you have the script, click "cancel" and don't apply the changes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM