Solved

truncate in sqlite

Posted on 2011-03-23
3
1,012 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
Comment Utility
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
Comment Utility
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
Comment Utility
i fiound solution on my own
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
ODBC Informix Driver 11 92
frontend queries vanishing 3 54
Error when connecting to oracle 11g via access 2013 18 60
Folder Replication 4 45
SQL Command Tool comes with APEX under SQL Workshop. It helps us to make changes on the database directly using a graphical user interface. This helps us writing any SQL/ PLSQL queries and execute it on the database and we can create any database ob…
Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
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…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now