Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 4 of 4 total |
How to modify and extend PRIMARY KEY by SQL |
Tue, Jul 10 2007 6:20 PM | Permanent Link |
Jan Hornstrup | Hi.
Can anybody help me how to modify an existing PRIMARY KEY. My existing DBISAM v3.x Table looks like this: Field DataType Size Primary index --------------------------------------------------------------- 1 Code Integer Yes 2 PortCode String 5 Yes 3 Name String 30 No etc...... Now I want to extend the PRIMARY KEY with an aditional field in First position. The new field is named LbNo and the datatype is AutoInc. The structure below, should be the new structure: Field DataType Size Primary index --------------------------------------------------------------- 1 LbNo AutoInc Yes 2 Code Integer Yes 3 PortCode String 5 Yes 4 Name String 30 No etc...... As this gives me "more" gray hair, I am looking forward to any answers !!! Brgds Jan Hornstrup Soft-Team Denmark (jhc@soft-team.dk) |
Tue, Jul 10 2007 6:43 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Jan,
<< Can anybody help me how to modify an existing PRIMARY KEY. >> Do you want to use SQL or code ? I'm assuming SQL because that's the newsgroup that you used, but I just want to make sure. -- Tim Young Elevate Software www.elevatesoft.com |
Wed, Jul 11 2007 1:29 PM | Permanent Link |
Jan Hornstrup | Hi Tim.
Yes, I want it in SQL-code, as I should provide it for many of our customers ! Brgds Jan Hornstrup "Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote: Jan, << Can anybody help me how to modify an existing PRIMARY KEY. >> Do you want to use SQL or code ? I'm assuming SQL because that's the newsgroup that you used, but I just want to make sure. -- Tim Young Elevate Software www.elevatesoft.com |
Wed, Jul 11 2007 7:45 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Jan,
<< Yes, I want it in SQL-code, as I should provide it for many of our customers ! >> Use something like this: ALTER MyTable DROP PRIMARY KEY, ADD PRIMARY KEY (LbNo, Code, PortCode); -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Sunday, May 5, 2024 at 10:18 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |