SQL Script for Bulk Un-association

Howdy all you fine folks, 

Wondering if someone has a script they'd be willing to share. 

We are doing some clean up with our ER contact storage for our recreational division school. We used to associate ER Contacts with the student account. I have a list of all of these associated accounts, and I would like to be able to run a script that will bulk un-associate all these people with the student accounts. Has anyone done this? Tessitura was unable to provide a script without going through Professional services, and I don't have quite this level of SQL knowledge to invent this script on my own. 

Thanks, all! 

Nicki 

Parents
  • Hi Nicki,

    I'm thinking about this off the top of my head, so please take with a grain of salt and (test, test, test in Test!), but you should be able to at least inactivate the associations using something like 

    update t_association
    set inactive = 'Y'
    where association_type_id = xxxx (whatever the id number is of the association you want to undo)

    Or, now that I write that out, maybe:
    delete from t_association
    where association_type_id = xxxx

    (I hate deleting via sql, and will always opt for inactivating as its less of an "oops" if i goof)

    Please, please, please play with this in Test first, especially as I'm not in ssms while writing this!

  • Thanks, Kathleen! The inactive one worked perfectly. You rock!!

Reply Children
No Data