|
Home > Archive > microsoft.public.sqlserver.server > August 2002 > RE: HOW to find "string" in all SQL Server DB
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
RE: HOW to find "string" in all SQL Server DB
|
|
| new user 2002-08-14, 8:23 am |
| x-no-archive: yes
Hi,
I am wondering if it's possible to search for a string (e.g. "aaa") in
all tables (more then 70) of a sql server database (running on sco
unixware 2.1.*).
I just want to run a query against the db to find out the records that
contains "aaa" string because I need to replace them with "bbb"(exactly
how many columns of all tables contain "aaa" string of a very large
database (over 70-80 tables ~). Not sure a sqk can do it...like manually
adding so many tables would not be good approach/option.
I have used client (SQL advantage, powerbuilder, Platinum desktop dba)\
though they don't have any built-in functionality to do this kind of search.
Thanks in advance for any directions/solutions....
Please post so other could make use of info!
| |
| Tibor Karaszi 2002-08-14, 9:23 am |
| You could use some nested cursors to loop the tables and loop the columns from there
constructing dynamic cursors. You would read the meta data using the system tables or
information_schema views. But as you say you are running SQL Server on Unix, I assume that it is
not MS SQL Server (perhaps Sybase?). And these do not look the same anymore...
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=...ublic.sqlserver
"new user" <plsnote@replydirection.nospamplease.net> wrote in message
news:3D5A5DF1.4000904@replydirection.nospamplease.net...
> x-no-archive: yes
>
> Hi,
>
> I am wondering if it's possible to search for a string (e.g. "aaa") in
> all tables (more then 70) of a sql server database (running on sco
> unixware 2.1.*).
>
> I just want to run a query against the db to find out the records that
> contains "aaa" string because I need to replace them with "bbb"(exactly
> how many columns of all tables contain "aaa" string of a very large
> database (over 70-80 tables ~). Not sure a sqk can do it...like manually
> adding so many tables would not be good approach/option.
>
> I have used client (SQL advantage, powerbuilder, Platinum desktop dba)\
> though they don't have any built-in functionality to do this kind of search.
>
> Thanks in advance for any directions/solutions....
> Please post so other could make use of info!
>
|
|
|
|
|