Toad World® Forums

No primary key generated in MSSQL 2005 model


#1

Hi,
I have a problem generating DDL scripts for MSSQL 2005. There is no primary key in the generated script.
Even thoug I used reverse eng. for model creation.
Foreign keys seem to be OK. Scripts for other DBs (e.g. Oracle) are OK.
I have a version 3.1.4.10 but occured in 3.1.3.56 too.

Any idea?

Many thanks

Cutty


#2

Hello Cutty,

Unfortunately, we’ve failed to simulate the problem.
Cutty, does this problem occur also in new SQL Server models?
Are you able to reproduce the problem?
If it occurs also in new models, please write us what you do - step by step.

Thanks very much in advance.

We look forward to hearing from you.

Regards,

Vladka + TDM Team


#3

Hi Vladka,
It doesn’t matter if it’s a new model or created in older version.

I create a physical model for MSSQL2005, create one entity, add a field, set Primary key and choose ‘generate DDL’.
I select all in ‘What To Generate’ (double check all keys are included) and ‘by property Generate’ in ‘Entity List’ (I can select entities manually with same result)

Then I press Generate and script is generated without PK.

See attachments with model and script generated

Couldn’t be problem related to Windows version? I have Czech Windows XP Prof + SP2 with english regional settings.
I’ll try it in english version of WXP

Thanks & regards

Cutty
Generated.SQL (632 Bytes)


#4

Hi Vladka,
It doesn’t matter if it’s a new model or created in older version.

I create a physical model for MSSQL2005, create one entity, add a field, set Primary key and choose ‘generate DDL’.
I select all in ‘What To Generate’ (double check all keys are included) and ‘by property Generate’ in ‘Entity List’ (I can select entities manually with same result)

Then I press Generate and script is generated without PK.

See attachments with model and script generated

Couldn’t be problem related to Windows version? I have Czech Windows XP Prof + SP2 with english regional settings.
I’ll try it in english version of WXP

Thanks & regards

Cutty
TestPK.txp (22.6 KB)


#5

Hello Cutty,

I’ve managed to reproduce the problem, however only in your model.
If I understand well, you encounter the problem in old models created in previous TDM3 versions and also in new models created in the latest Beta. Am I right?
If so, it is really strange as it works fine for us.

Anyway, I recommend you to open the DDL Script Generator dialog, clear the checkbox Keys and select it again. Then generate the script. It should be OK.

I’ve resent your model to our testers, they will try to find out the cause of the problem. If they have any questions, I’ll write again.

Thanks in advance.

Regards,

Vladka + TDM Team


#6

Hello Vladka,
I tried to uncheck and check again Key checkbox and changed extended value and it works almost fine now.
The only problem is that value of Extended Value doesn’t change generated script - both primary and alternate keys are generated in all cases.
It’s the same in new models too.

Thanks and regards

Cutty


#7

Hello Cutty,

Thanks for the information provided. We’re racking our brains for this problem and would like to ask you for more co-operation.

  1. Please send us your MS SQL Server 2005.txo file where Object Types and Properties (OTPs) for this db are stored.
    Default location is:
    C:\Documents and Settings\user name\My Documents\Toad Data Modeler Beta\Selected OTPs

Please send it to: modeling@quest.com.

  1. Back up your models (and possibly versions, revisions of Version Manager, aliases for RE etc. - all you need to preserve) and do complete uninstall and reinstall of latest Beta.
    After you uninstall the Beta, see these two locations (default paths):
    a) C:\Documents and Settings\user name\My Documents\Toad Data Modeler Beta
    Back up the files you need and delete all directories here.
    b) C:\Documents and Settings\user name\Application Data\Quest Software\Toad Data Modeler Beta
    Here, you can back up files created in Version Manager if you created any. Then, again, delete all the directories here.

Then install the Beta again.

Let us know if the problem occurs after the complete reinstall. Thanks very much!

We look forward to hearing from you soon.

Regards,

Vladka + TDM Team


#8

Hello Vladka,
I have sent the requested file, reinstalled TDM following instructions (BTW I have done it before sending this thread to forum) and was successful reproducing the problem.

I reinstalled TDM, run it and created simple model with one entity, one field, one key. Then I pressed F9 and generated the script. PK was generated.
I noticed that ‘before’ and ‘after’ scripts are not checked in ‘What To Generate’ tab so I clicked on ‘Select All’ icon. When I pressed ‘Generate’ again the script was WITHOUT PK.

After ‘Deselect All’ and ‘Select All’ again it works fine. When I close the form (without saving settings) and open it again it’s the same as for the first time so I can reproduce it again and again.

I think the problem is in ‘Select All’ action.

I hope it helps.

Regards,

Cutty


#9

Hello Cutty,

Thanks very much for your help. After clicking the Select All button we were successful to reproduce the problem.

It is a bug. CR # 46 430

As soon as I have more details on the fix from our developers, I’ll write you back.

Thanks very much for now.

Regards,

Vladka


#10

Hi Cutty,

Here I’m with an update on this issue. CR # 46 430 has been resolved for next official release 3.1.5 and also in upcoming Beta 3.1.6.

Thanks for your great co-operation once again!

Regards,

Vladka