|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
General - Deleting Data from Database
I know Ive seen this before and did do a search but didnt have any luck so sorry for the repeat.
But I have been playing with a database and finally have it about where I need it, functionally. But in the process of learning I have put in tons of records in multiple tables and was wondering if theres a way to wipe all the data from my db so that all records autonumbers begin with 1 again but leaving the tables and format of the db alone. Thanks, |
|
#2
|
||||
|
||||
|
To delete all records from a table, just run a Delete Query with no criteria. But that won't reset Autonumbers to 1. That's somewhat difficult to do, and I'd have to research how to do so. But the real question is, Why would you want to? The purpose of an Autonumber is to serve to assure that there can be no duplicates in a primary key field. The value is totally meaningless, and it's good practice to never even display such ID numbers to users. So there's really no valid reason to try to reset Autonumbers. If you are using Autonumbers for human reference, and anyone cares about what the numbers are, you're not using them for what they are designed for.
__________________
Experience is the thing you have left when everything else is gone. |
|
#3
|
|||
|
|||
|
I've found that after deleteing all data from my tables, when I do a compact and repair on the database, autonumber will start from 1 again.
To delete the data I personally just open up the database window, open the table, select everything and delete manually... Then again I don't have THAT many tables to do it too so a delete like don suggests might be quicker if you have many tables. |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > General - Deleting Data from Database |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|