Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1057065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:48:33+00:00 2026-05-16T17:48:33+00:00

My version of SQLite does not support the IF EXISTS operator. How can I

  • 0

My version of SQLite does not support the IF EXISTS operator. How can I drop a table which may or may not exist without getting an error slapped at me?

I can’t update the version on a live application right now, so I cannot use a SQLite version that supports IF EXISTS.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T17:48:33+00:00Added an answer on May 16, 2026 at 5:48 pm

    The official documentation says to use IF EXISTS, so I suspect your best plan is to upgrade.

    If you can’t, you need to see whether you can do some trivial operation on the table that will succeed whether or not the table is empty; if it succeeds you should delete the table, if it fails the table is already gone. An example of the sort of operation to try might be:

    SELECT COUNT(*) FROM theTable;
    

    Note that you need to trap the possible error from this at the language level, and you might want to wrap the whole lot (probe, error-trap, drop table) in a transaction. Of course, the other approach if you’re getting into error handling is to just drop the table and handle the error anyway.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Xerial latest jdbc driver for sqlite (version 3.7.2) It does not
I currently have an app in the store which is SQLite-backed and does not
My SQLite is version 3.4.0: image However my phpinfo's PDO support for SQLitev3 is
I'm having problems with SQLite in Android. Eclipse does not report any error in
The new version of SQLite has the ability to enforce Foreign Key constraints, but
I've successfully compiled my WinRT version of SQLite for x86 as described by Tim
Anyone know why Subsonic 2.2 uses System.Data.SQLite version 1.0.60.0 instead of the latest version
I'm at my wits end with the best .NET assembly version of SQLite, the
I installed alembic 0.3.4, sqlalchemy, SQLite version 3.7.4, and upgraded SQLAlchemy 0.6.4 to SQLAlchemy
Is there a .Net 4 version of System.Data.SQLite? At the moment I get this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.