Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 05 Apr 2012, 10:21
flyguye flyguye is offline
 
Join Date: Mar 2012
SQL Query : Mass move specific users based on usernames, not userid

Hi,

I need to mass move specific users (a couple of hundred of them) based on their usernames, not based on their id, to be deleted at a later time.

Each user is unique, with differing post counts, join dates, etc.

I've tried to mess around with some SQL queries but no luck.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I have the usernames on excel so if I could add them into the query either comma separated, or space separated, or line separated would be great!

I've no knowledge on SQL, so I might be shootin' in the dark here!
Reply With Quote
  #2  
Old 05 Apr 2012, 10:24
Pandemikk Pandemikk is offline
 
Join Date: Jul 2009
Real name: Jon

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Only problem is you have to make sure the username's are escaped. Feel free to PM me a list of the username's and I'll write up a quick script that'll get the job done.
Reply With Quote
  #3  
Old 05 Apr 2012, 10:49
flyguye flyguye is offline
 
Join Date: Mar 2012
Very kind of you sir! However the list isn't finalized yet, will PM you the list once it's finalized!

However, I don't understand what you mean by the usernames being escaped?

--------------- Added 05 Apr 2012 at 11:11 ---------------

Managed to do it!

I used excel to add the 'apostrophes' and appropriate spaces at the end of each username, and pasted it in the following format:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Where X is the target usergroupid

That allowed me to paste the all the usernames at one go!

Thanks again! SOLVED!
Reply With Quote
  #4  
Old 05 Apr 2012, 14:17
Pandemikk Pandemikk is offline
 
Join Date: Jul 2009
Real name: Jon
By escaped, I mean there are certain characters in usernames that would break the query, most notably an apostrophe itself. But seeing as how everything worked out I'm going to assume none of the username's had an apostrophe in them, anyway.

Glad I could be of assistance.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


New To Site? Need Help?

All times are GMT. The time now is 00:56.

Layout Options | Width: Wide Color: