CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • ANSWERED - Changing contact type on 90K records
Pages: [1]

Author Topic: ANSWERED - Changing contact type on 90K records  (Read 570 times)

jimmyjam

  • I post occasionally
  • **
  • Posts: 87
  • Karma: 4
ANSWERED - Changing contact type on 90K records
September 30, 2010, 07:26:32 pm
I created four sub-types of individual contact records, and added about 90K records that have sub-types:
  • Patient
  • Non-patient
  • Staff
  • Volunteer

Now my colleagues tell me they don't want our contact records to have sub-types. All individuals should be in a single bucket: "Individual".

My question is: can I run a SQL query in phpMyAdmin to revert all the individual contact records back to "Individual"?

Thanks,
James
« Last Edit: October 01, 2010, 05:01:45 am by jimmyjam »

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Changing contact type on 90K records
October 01, 2010, 01:05:35 am
Do you have any other data specific to contact sub type ?
If not the you can fire query to set contact sub type to null in civicrm_contact table. Make db backup before you do any db operation.

Kurund
Found this reply helpful? Support CiviCRM

jimmyjam

  • I post occasionally
  • **
  • Posts: 87
  • Karma: 4
Re: Changing contact type on 90K records
October 01, 2010, 04:12:39 am
Thanks, Kurund.

No, I don't have any data that is specific to the sub-types, and will definitely do a backup of the DB before running a query.

Can you help me translate "select all individual contact records and set the sub-type to null" into a SQL query? I am a SQL noob.

Thanks,
James

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Changing contact type on 90K records
October 01, 2010, 04:25:49 am
Quote
UPDATE  civicrm_contact SET  contact_sub_type = NULL;

This should work.

Kurund
Found this reply helpful? Support CiviCRM

jimmyjam

  • I post occasionally
  • **
  • Posts: 87
  • Karma: 4
Re: Changing contact type on 90K records
October 01, 2010, 05:00:26 am
awesome. thanks, kurund.

james

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • ANSWERED - Changing contact type on 90K records

This forum was archived on 2017-11-26.