?
Solved

truncate in sqlite

Posted on 2011-03-23
3
Medium Priority
?
1,080 Views
Last Modified: 2012-05-11
how can I truncate a table in sqlite? I tried DELETE FROM table; but it doesnt reset the auto incremental ID. any idea?
0
Comment
Question by:dinko1
  • 2
3 Comments
 
LVL 2

Expert Comment

by:8ubterfug3
ID: 35199795
The following resets the ID in SQL. Not positive about SQLLite. You could do

DELETE FROM tablename
DBCC CHECKIDENT('tablename', RESEED,0)

Open in new window

0
 

Accepted Solution

by:
dinko1 earned 0 total points
ID: 35199832
it says DBCC syntax error. It doesnt understand command.
Anyway I fixed my problem with the line:

DELETE FROM SQLITE_SEQUENCE WHERE NAME = 'tablename'
0
 

Author Closing Comment

by:dinko1
ID: 35230069
i fiound solution on my own
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lotus Notes has been used since a very long time as an e-mail client and is very popular because of it's unmatched security. In this article we are going to learn about  RRV Bucket corruption and understand various methods to Fix "RRV Bucket Corrupt…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question