If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Disabling Foreign Key

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-22-04, 03:25
zarierb zarierb is offline
Registered User
 
Join Date: Jun 2004
Posts: 26
Red face Disabling Foreign Key

Is it possible to disable a foreign key in DB2 v8 Universal Database.
Reply With Quote
  #2 (permalink)  
Old 12-22-04, 04:50
Wim Wim is offline
Registered User
 
Join Date: Nov 2004
Posts: 1,279
Code:
ALTER TABLE mytable
DROP FOREIGN KEY myforeignkeyname
;
If you don't know the name of the FK, check out the system table or do it the quick and dirty way: try to update the referencing column into a value that does not occur in the parent table.

Wim
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On