469,917 Members | 1,789 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,917 developers. It's quick & easy.

Problem in auto_increment

Hello,

My database table containing a column name P_ID

Field Extra = P_ID,
Type = int(11),
Null = NO,
Key = PRI,
Default = NULL,
Extra = auto_increment

1. If I delete any row from my table (eg. P_ID = 2) I dont get that P_ID even I insert any new data. Is it for auto_increment?

2. If I want to remove auto_increment from that attribute, how it possible?

Advance thanks.
Feb 6 '08 #1
1 1178
mwasif
802 Expert 512MB
1. Whenever you insert a new record, you get an incremented value. This is how auto_increment works.

2. Use the following query to remove auto_increment
Expand|Select|Wrap|Line Numbers
  1. ALTER TABLE table_name CHANGE P_ID P_ID INT( 11 ) NOT NULL
Feb 7 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Andrew | last post: by
5 posts views Thread by Paul Lamonby | last post: by
9 posts views Thread by Bart Van der Donck | last post: by
reply views Thread by Shailesh | last post: by
10 posts views Thread by Sjoerd | last post: by
1 post views Thread by webandwe | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.