Batch delete

Results 1 to 2 of 2

Thread: Batch delete

  1. #1
    Join Date
    Dec 1969

    Default Batch delete

    Greetings...<BR><BR>I want to delete a bunch of records (in sql) all at once, w/ one statement. Is this possible? They&#039re not continuous, and for the purposes of good coding they&#039re not related in any way except that the user has chosen to delete them.<BR><BR>something like<BR><BR>delete from table where id = 1, id = 2, id = 512, id = 4<BR><BR>Is this possible?<BR><BR>Ben

  2. #2
    Join Date
    Dec 1969

    Default RE: Batch delete

    Ben-<BR><BR>You could (although I wouldn&#039t advise) use &#039IN" where you would delete from table where id IN (114, 224, 145).<BR><BR>I usually write a function and pass in the id to delete and do it that way. create an array of of id&#039s to delete and then zip through the array deleting each item in it. make sense?<BR><BR>hope that helps.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts