Tell me more ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I'm been taxed with the task of creating an application that pulls data from our Micros Point of Sales system. The POS is using a Sybase database running on one of our servers. The database schema is very convoluted. I've been able to figure out most of the schema to gain access to the data I need, however, there are a few things still left to find. I know what they are called in the actual POS, but I can't seem to find them anywhere in the database (although I haven't actually looked through all 200+ tables).

I'm wondering if there's any way to run a query to search for a specific string in all the columns in all the tables. BTW, I'm using the "Interactive SQL" application that comes with the Sybase Database Client software to connect to the database.

share|improve this question
No, not possible. Easiest way to do this would be to write a perl or python script that iterates through a query based on systable/syscolumn. Pulling an entire database through a script is expensive, but I'm sure you know that already. – Phil Mar 9 at 1:00
These question mention some tools and some t-sql solutions stackoverflow.com/q/5818598/330315 and stackoverflow.com/q/8435963/330315 and stackoverflow.com/q/5350088/330315 – a_horse_with_no_name Mar 9 at 9:55

2 Answers

You can do a query like this:

Select o.name as table, c.name as column from syscolumns c, sysobjects o
Where c.id = o.id and
c.name like "stringImLookingFor"

The first name is the table name and the second name is the column name. You can use '%' as a wild card if you don't know the exact name you are looking for.

share|improve this answer

If it's practical to dump the database to disk as text, you can just use ordinary text utilities to search the dump. grep is your friend.

share|improve this answer
It's a Sybase ASE database, so a dump is a binary file, that can't be grepped. – Michael Gardner Mar 11 at 16:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.