Jump to content


Photo

Query In A Specific Table In All Databases


  • Please log in to reply
3 replies to this topic

#1 Seyfi Go

Seyfi Go

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 27 September 2011 - 02:26 AM

Hello,

i must create a query and need your help

i have 134 databases under same connection.

i must execute a query for finding and removing the rows including "string1,string2,...string8" from "wp-post" tables
but without querying all of tables.

which is the best way to find and delete the rows with theses strings without querying more than 2650 tables in 134 databases.

i will be grateful if you can help me

Best Regards
seyfigo

#2 peterlaursen

peterlaursen

    Advanced Member

  • Admin
  • PipPipPip
  • 7,869 posts
  • Gender:Male
  • Location:Skagen, Denmark
  • Interests:well ... jazz/folk music, photography, chess, nature, ecology, history, bicycling, Highland Malts ... well, Lowland Malts and Cognac too actually :-) just wonder how I get the time to touch a computer! SQLyog and MONyog? no that's not interest, that's BASIC NEEDS simply!

Posted 27 September 2011 - 06:41 AM

You should consider using the Data Search feature introduced in SQLyog Ultimate 9.1 and 9.2. Refer http://webyog.com/fa...on-history.html

Once the rows have been found you can check the checkbox for each (shift+click operator is suported) and delete. It willl still take a little time but much faster than executing a query for each table. Please first read about Data Search in the help file (help .. help menu) to understand exactly how it works - and I would also enssure a backup first.


Computers make your grey hair come off ....

Peter Laursen
Webyog

#3 Seyfi Go

Seyfi Go

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 14 November 2011 - 12:23 AM

You should consider using the Data Search feature introduced in SQLyog Ultimate 9.1 and 9.2. Refer http://webyog.com/fa...on-history.html

Once the rows have been found you can check the checkbox for each (shift+click operator is suported) and delete. It willl still take a little time but much faster than executing a query for each table. Please first read about Data Search in the help file (help .. help menu) to understand exactly how it works - and I would also enssure a backup first.



Dear Peter,

thank you for your response but i have entreprise version ! not ultimate, is there a way to make it with sql queries ?

thaank you


Seyfi Go
www.seyfi.org

#4 Jan.S

Jan.S

    Advanced Member

  • Members
  • PipPipPip
  • 40 posts
  • Gender:Male

Posted 14 November 2011 - 08:15 AM

Hi Seyfigo,

You can use the attached stored procedure. It can be created in any of your databases and then executed using CALL search('text to search').

You might want to try it on some test data, and then modify it to suit your needs.

Regards,
Janani

Attached Files






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users