User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MS Access and FileMaker Pro section within the Web Development category of DaniWeb, a massive community of 391,588 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,634 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS Access and FileMaker Pro advertiser:
Views: 604 | Replies: 1
Reply
Join Date: May 2006
Posts: 4
Reputation: karkar_87 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
karkar_87 karkar_87 is offline Offline
Newbie Poster

Increment ID

  #1  
Jun 16th, 2008
Hi All,

I got a question regarding sql.

I got some data in a ms access.

There's 3 columns, namely id, name and address. Here's an example.

id    name      address
1     a            c
2     c            d
3     d            e
.
.
.
.
100

And, I need to insert a row between 1 and 2. And, the id for 2 to 100 should increment by 1. Is there a sql statment which can do that?

Thanks alot.

I have been searching google for the past few days and I couldn't get the keyword correct.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jan 2007
Posts: 2,510
Reputation: MidiMagic is on a distinguished road 
Rep Power: 7
Solved Threads: 103
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Posting Maven

Re: Increment ID

  #2  
Jun 19th, 2008
SQL usually does not do that. It wants to keep the same ID for the same record in perpetuity.

The easiest way would be to delete the numbered column, then add it again as an autonumbering field. But it must not be the field the data is sorted on, and it must not be a primary key.
Last edited by MidiMagic : Jun 19th, 2008 at 2:28 pm.
Daylight-saving time uses more gasoline
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb MS Access and FileMaker Pro Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the MS Access and FileMaker Pro Forum

All times are GMT -4. The time now is 11:07 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC