Set Van in lastnames to van

From TNG_Wiki
Jump to navigation Jump to search

Desktop programs tend to capitalize all the first letters in last names. So you get John Van Beertenstein Tot Huppeldepup. This query changes that to John van Beertenstein tot Huppeldepup. This queries changes Van, De, Tot, Der, and 'S to van, de, tot, der and 's. Most likely there are more combinations possible so change that or add this here.



Copy and paste the text between the lines into the MySQL section of your MySQL admin, IMPORTANT: Make a backup before you try anything and use this at your own risk!


update tng_people set lastname=insert(lastname,instr(lastname, ' Van ' ), length(' Van '), ' van ');
update tng_people set lastname=insert(lastname,instr(lastname, ' De ' ), length(' De '), ' de ');
update tng_people set firstname=insert(firstname,instr(firstname, ' Van ' ), length(' Van '), ' van ');
update tng_people set firstname=insert(firstname,instr(firstname, ' De ' ), length(' De '), ' de ');
update tng_people set lastname=insert(lastname,instr(lastname, ' Tot ' ), length(' Tot '), ' tot ');
update tng_people set firstname=insert(firstname,instr(firstname, ' Tot ' ), length(' Tot '), ' tot ');
update tng_people set lastname=insert(lastname,instr(lastname, ' Der ' ), length(' Der '), ' der ');
update tng_people set firstname=insert(firstname,instr(firstname, ' Der ' ), length(' Der '), ' der ');


update tng_people set lastname=insert(lastname,instr(lastname, '  \'S ' ), length('  \'S '), '  \'s  ');
update tng_people set lnprefix=LOWER(lnprefix);