# Enhancement & Problem on Generated SQL script for MySQL5

**URL:** <https://forums.toadworld.com/t/enhancement-problem-on-generated-sql-script-for-mysql5/1353>\
**Category:** Toad Data Modeler\
**Created:** [November 24, 2007, 5:28am UTC](https://forums.toadworld.com/t/enhancement-problem-on-generated-sql-script-for-mysql5/1353 "2007-11-24T05:28:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chi](https://avatars.discourse-cdn.com/v4/letter/c/0ea827/32.png) [@Chi](https://forums.toadworld.com/u/Chi)\
**Post date:** [November 24, 2007, 5:28am UTC](https://forums.toadworld.com/t/enhancement-problem-on-generated-sql-script-for-mysql5/1353/1 "2007-11-24T05:28:27Z")

</div>

Hi

I have created a table on Toad Data Modeller, I try to use the SQL script that generated by “DDL Script Generation function” to create the table and primary key. Unfortunately when I run the sql script on MySQL Query Browser It display an error message “Incorrect Table Definition; there can be only one auto column and it must be defined as a key”

I guess that problem occur is because the primary key is created after the creation of the table. Is there any way I can get around this problem if not I would be grateful if that problem can be solve in next beta.

Another thing I would like to mention is in MySQL only 1 column in a table can be use as auto-increment. Would it be possible to have little bit validation when you design/create the table in toad, if you detect there has anther field that has been set to auto-increment in the same table, it would notice the user.

Another feature I would like to add on Toad data modeller is, to allow user to change some settings on the database E.g. Collation, type …etc.  
And also provides an option for the user which could allow whether they want the “DDL Script Generation function” to generate the Database script for them. E.g. Create Database script.

Please let me know if you want me to explain more.

Many thanks

Chi

---

<div class="post-metadata">

**Author:** ![ECU\_Scott](https://avatars.discourse-cdn.com/v4/letter/e/a183cd/32.png) [@ECU\_Scott](https://forums.toadworld.com/u/ECU_Scott)\
**Post date:** [November 24, 2007, 10:50pm UTC](https://forums.toadworld.com/t/enhancement-problem-on-generated-sql-script-for-mysql5/1353/2 "2007-11-24T22:50:00Z")

</div>

I am having the same issue. It would be really cool if we had the option to define the Primary Key Inline or if it would do it automatically if the priamry key attribute is set to AUTO\_INCREMENT.

Any ideas on getting around this issue would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![arki55](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@arki55](https://forums.toadworld.com/u/arki55)\
**Post date:** [November 26, 2007, 1:41am UTC](https://forums.toadworld.com/t/enhancement-problem-on-generated-sql-script-for-mysql5/1353/3 "2007-11-26T01:41:01Z")

</div>

I think these problems were reported multiple times already.  
There was some kind of MySQL hot fix for final 3.0 version.

[http://modeling.inside.quest.com/thread.jspa?threadID=5069&tstart=0](http://modeling.inside.quest.com/thread.jspa?threadID=5069&tstart=0)

I can’t validate the content of the hotfix, the quest page requires login.  
(odd, login for a hotfix download?)

---

<div class="post-metadata">

**Author:** ![vladka](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/vladka/32/41_2.png) [@vladka](https://forums.toadworld.com/u/vladka)\
**Post date:** [November 26, 2007, 7:11am UTC](https://forums.toadworld.com/t/enhancement-problem-on-generated-sql-script-for-mysql5/1353/4 "2007-11-26T07:11:42Z")

</div>

Hello all,

To the 'Autoincrement problem':

Arki provided you with a hotfix for official TDM3 version.

Here's a hotfix for TDM3 BETA 3.1.1.166:  
[http://modeling.inside.quest.com/entry.jspa?externalID=1254&categoryID=34](http://modeling.inside.quest.com/entry.jspa?externalID=1254&categoryID=34)

Please see my announcement at:  
[http://modeling.inside.quest.com/thread.jspa?threadID=4872&tstart=0](http://modeling.inside.quest.com/thread.jspa?threadID=4872&tstart=0)

All hotfixes for BETA are available in the Library section at:  
[http://modeling.inside.quest.com/kbcategory.jspa?categoryID=34](http://modeling.inside.quest.com/kbcategory.jspa?categoryID=34)

Chi, to your suggestions:

> I would like to mention is in MySQL only 1 column in a table can be use as auto-increment. Would it be possible to have little bit validation when you design/create the table in toad, if you detect there has anther field that has been set to auto-increment in the same table, it would notice the user.

O.K. We will deal with it. CR # 39 203.

> Another feature I would like to add on Toad data modeller is, to allow user to change some settings on the database E.g. Collation, type ...etc. And also provides an option for the user which could allow whether they want the "DDL Script Generation function" to generate the Database script for them. E.g. Create Database script.

If you like to use e.g. CREATE DATABASE statement etc., you can write it to: Model menu | Model Properties | Before Script tab.

If you have any questions, please write us back. Thanks.

Regards,

Vladka + TDM Team
