Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. SQL Query (on access)

SQL Query (on access)

Scheduled Pinned Locked Moved Database
databasec++comdata-structureshelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jeremy Pullicino
    wrote on last edited by
    #1

    HI, Can someone help me with following SQL? I have an array of about 200 string IDs in my program (C++). I need to delete these IDs from a database table. I would like to use the most efficent method of doing this. Any suggestions on the best SQL query? Thanks Jeremy Pullicino C++ Developer Homepage

    G D 2 Replies Last reply
    0
    • J Jeremy Pullicino

      HI, Can someone help me with following SQL? I have an array of about 200 string IDs in my program (C++). I need to delete these IDs from a database table. I would like to use the most efficent method of doing this. Any suggestions on the best SQL query? Thanks Jeremy Pullicino C++ Developer Homepage

      G Offline
      G Offline
      Guillermo Rivero
      wrote on last edited by
      #2

      If your id columns is numeric, try this... DELETE FROM [Table] WHERE [ID_Column] IN (1,2,3,...,n) If it's string... DELETE FROM [Table] WHERE [ID_Column] IN ('1','2','3',...,'n) Free your mind...

      1 Reply Last reply
      0
      • J Jeremy Pullicino

        HI, Can someone help me with following SQL? I have an array of about 200 string IDs in my program (C++). I need to delete these IDs from a database table. I would like to use the most efficent method of doing this. Any suggestions on the best SQL query? Thanks Jeremy Pullicino C++ Developer Homepage

        D Offline
        D Offline
        Dr_X
        wrote on last edited by
        #3

        Use the In Clause to execute the query.

        DELETE FROM [TableName]
        WHERE ID IN (1,2,3,4,5,6,etc...200)

        I know Sysbase 11 had a limit of 255 values in the In Clause. However, I do not think SQL Server or Access has that limitation. Michael

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups