Skip to Main Content

SQL Developer

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problem with foreign and primary keys migration from SQL Server to Oracle

729362Oct 21 2009 — edited Oct 23 2009
Hi folks, i'm using SQL Developer to migrate from a SQL Server database to Oracle and i'm stuck with a couple issues:

The worst of them so far is the fact that i can't migrate any of the PKs and FKs. After successfully capturing the SQL Server DB model and converting it to Oracle, when the tool generates the scripts, all ALTER TABLE queries that add the PKs and FKs have their target columns duplicated.

for example: when i'm trying to migrate a simple table that contains an Id (PK) and Name columns, the tool generates the following scripts:


PROMPT Creating Table TestTable...
CREATE TABLE TestTable (
Id NUMBER(10,0) NOT NULL,
Name VARCHAR2 NOT NULL
);

PROMPT Creating Primary Key Constraint PK_TestTable on table TestTable ...
ALTER TABLE TestTable
ADD CONSTRAINT PK_TestTable PRIMARY KEY
(
Id,
Id
)
ENABLE


As for the FKs, the tool duplicates the columns as well:

ALTER TABLE SomeTable
ADD CONSTRAINT FK_SomeTable_SomeTable2 FOREIGN KEY
(
SomeTable2Id,
SomeTable2Id
)
REFERENCES SomeTable2
(
Id,
Id
)
ENABLE
;

Does anyone have a clue on how to solve these issues? I'd be greatly thankful for any answers!
This post has been answered by Dermot ONeill-Oracle on Oct 22 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 20 2009
Added on Oct 21 2009
7 comments
1,680 views