merging in bulk

Hi everyone,

We are doing some database cleanup and I have a very long list of constituent ids that need to be merged into one keep id (old tnew guest checkout records with no identifying info on them).  I know I can inactivate all of these records,but people would rather they be merged.  Has anyone done a bulk merge in SQL?  I'm having some trouble when I test it out in Test, and if anyone was willing to share some code, I would be eternally grateful.  (we're on 15.0.3).

thanks,
Kathleen

Parents Reply Children
  • Jennifer,

    Honestly, outside of maybe 3-5 lines of code here and there, I have become not a big fan of posting large swaths of code on forums, mostly simply because copy/paste issues often make it worthless without fully re-typing anyway.  I was not always this way, but more and more I find that it simplifies just not to post code (also, because sometimes I make mistakes posting, and then there are two posts out there; one with the wrong code and the other correcting it).  This particular bit of code uses a cursor as well, and cursors can be trouble when everything is ideal (leave a couple of lines out and your cursor will literally never stop), so I am just hoping to avoid any potential issues with that.

    And this code is not really conducive to a shared report as is.  I suppose someone might be able to work it into something that could be shared like that, but as it currently stands it is just easiest for me to keep e-mailing it.  Slight smile

    But I am indeed more than happy to keep e-mailing it to people.  If you do not wish to post your e-mail to the whole forum, I understand that.  But if you (or anyone else) is not; I am comfortable with that and have done in the past, so here it is again:  jmoskal@thecenterpresents.org, for anyone that wishes to send one to me.  Hopefully that will suffice.

    John

  • sometimes I make mistakes posting, and then there are two posts out there; one with the wrong code and the other correcting it

    Hear, hear! ;-)