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. Delete SQL

Delete SQL

Scheduled Pinned Locked Moved Database
databasehelpquestion
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.
  • S Offline
    S Offline
    simworld
    wrote on last edited by
    #1

    delete from table1,table2 where uid='abc' the conditon ( where uid='abc') is same for both table. that uid field are present in both table. I got error that Comma(,) should not be there is there any other syntax that can work?

    M P 2 Replies Last reply
    0
    • S simworld

      delete from table1,table2 where uid='abc' the conditon ( where uid='abc') is same for both table. that uid field are present in both table. I got error that Comma(,) should not be there is there any other syntax that can work?

      M Offline
      M Offline
      Mike Dimmick
      wrote on last edited by
      #2

      You can only delete from one table at a time. You'll need to write two statements. Many providers can handle multiple statements in the same batch.

      DoEvents: Generating unexpected recursion since 1991

      1 Reply Last reply
      0
      • S simworld

        delete from table1,table2 where uid='abc' the conditon ( where uid='abc') is same for both table. that uid field are present in both table. I got error that Comma(,) should not be there is there any other syntax that can work?

        P Offline
        P Offline
        Paul Conrad
        wrote on last edited by
        #3

        You can only delete from one table at a time. If you want to delete from more than one at a time, using only one command, then try using a stored procedure that executes the individual table deletes in one call. ---modified If there is a relationship between table1 and table2 with uid, then you could always setup a cascading delete based on that field.

        "I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon

        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