Import SQL DB - PK comes over as Unique constraint


Author
Message
Charles R Hankey
Charles R Hankey
StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)
Group: Forum Members
Posts: 524, Visits: 30K
I imported a VFP database to DDT, made the necessary corrections and created a SQL database.

All went well.  Then realized I didn't want clustered UID pks. Made the change in DDT but DDT could not uncluster the indexes ( error said they had to be dropped and recreated and DDT didn't seem to want to do that )

Okay, so I used T-SQL to drop all constraints, keys etc on all the tables in the sql dbc.  Then I recreated all the pks as non-clustered.

Now I wanted to reimport into DDT.  Decided to do it into a different project.  i think that is where it started to go wrong.  All the structure came over and the indexes came over but they are just unique constraints - not primary keys and will not accept a default value of NEWID()

They show up as primary in the field list

but the index

If I try to add NEWID() as a default value I get

DataLayerSavingException
  The INSERT statement conflicted with the FOREIGN KEY constraint "fk_indexes_indexfields". The conflict occurred in database "StrataFrame", table "dbo.DBEIndexes", column 'idx_pk'.
The statement has been terminated.
SqlException
  The INSERT statement conflicted with the FOREIGN KEY constraint "fk_indexes_indexfields". The conflict occurred in database "StrataFrame", table "dbo.DBEIndexes", column 'idx_pk'.
The statement has been terminated.

I haven't had this problem with my other databases

I tried completely deleting all the DDT projects connected with this database and then importing to a new project in DDT but get the same result.

To test this :

I created a new database called Testit.  One table Names ( ckey UID, cname char(10) )

Created PK on ckey

Imported into a new DDT project and got the same result.  pk_ckey is Unique Constraint, not PK

Am I doing something wrong or is this a bug?  Don't think I had this problem in 1.6

Reply
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Charles,

I have not reproduced this one issue just yet.  I beleive you, I just have not got it in a reproducable format yet since I need to go manually create a SQL table first....I always use the DDT Smile.  So it is on my list of things to reproduce before the next release, but I just have not had the chance to reproduce this yet.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search