Solved

truncate in sqlite

Posted on 2011-03-23
3
1,070 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
Recently I was talking with Tim Sharp, one of my colleagues from our Technical Account Manager team about MongoDB’s scalability. While doing some quick training with some of the Percona team, Tim brought something to my attention...
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

688 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