473,396 Members | 1,671 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Finding out all the User Tables being used by an application


Here's the situation, developers inherit a web app from someone,
backend SQL db has about 120 user tables and the db is also being used
by other apps. Developers don't have a list of user tables being used
by this app, now, I need to create a new db based on this one, which
would be used by this app only. So, I intend to find all the user
tables being used by this app, then copy its schema and possibly data
as well to a new db. FYI, current ERD is not this app.

One option to find out all the user tables being used by this app is to
do recursive search for FROM and JOIN against the full spectrum of the
uncompiled source code, then, weed through such an extracted list when
in doubt about a particular table, one caveat is a portion of code with
sql stmt could have already been commented (no longer being used though
still in the code).

Better option?

TIA.

Jul 23 '05 #1
3 2111
NickName (da****@rock.com) writes:
Here's the situation, developers inherit a web app from someone,
backend SQL db has about 120 user tables and the db is also being used
by other apps. Developers don't have a list of user tables being used
by this app, now, I need to create a new db based on this one, which
would be used by this app only. So, I intend to find all the user
tables being used by this app, then copy its schema and possibly data
as well to a new db. FYI, current ERD is not this app.

One option to find out all the user tables being used by this app is to
do recursive search for FROM and JOIN against the full spectrum of the
uncompiled source code, then, weed through such an extracted list when
in doubt about a particular table, one caveat is a portion of code with
sql stmt could have already been commented (no longer being used though
still in the code).


If you have the source under version control in SourceSafe and it is
written Visual Basic, C++ or SQL, you can have a look at SSGREP and
SSREPLACE, two tools in my toolset AbaPerls, available from
http://www.abaris.se/abaperls/index.html.

For this particular quest, you would probably best use SSREPLACE to
search for all database tables in the source, and then check how many
hits you got per table. The assumption is that the table names are
distinct enough not to give false positive. The two tools are smart
enough to not search comments, so you don't have to worry about that
part.


--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #2
Erland,

Thank you. Your recommended tool sounds perfect for the job,
unfortunately we are not allowed to use outside tool for the job.
Good to know you would use similar approach to tackle the problem in
hand.

Don

Jul 23 '05 #3
NickName (da****@rock.com) writes:
Thank you. Your recommended tool sounds perfect for the job,
unfortunately we are not allowed to use outside tool for the job.


Il mio Dio!

Am I supposed to laugh or cry here?

Not that I think my tools would have been perfect, but they could have
saved you some boring work. And your employer some money. Or any other
tool that could have found. Oh well...
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Google Mike | last post by:
You know, while working on my moonlight corporation's LAMP project at home this weekend, I couldn't help but wonder if people writing similar projects are solving similar problems with having to...
2
by: Devesh Aggarwal | last post by:
Hi, I have a backup and restore module in my project. The backup uses a typed dataset object (XSD) to get the data from database and creates a xml file as the backup file (using the WriteXml...
2
by: Internet Arrow Limited | last post by:
Hi, I have a requirement to write an access application that must run under access97 and access2K. Some users will use Acess2K to access data that will also be accessed by Access97 users. The...
0
by: clintonG | last post by:
I applied aspnet_regsql to SQL2K which was working fine throughout Beta 2 development. After installing Visual Studio and SQL Express RTM my application has blown up. Logging in to the application...
3
by: Michael Glaesemann | last post by:
Hello all, Recently I've been thinking about different methods of managing users that log into a PostgreSQL-backed application. The users I'm thinking of are not necessarily DBAs: they're...
0
by: rkrishna | last post by:
Using Oracle 10G - Enterprise edition - 10.2.0.1.0 I am trying to use the proxy user feature in order to have all our security done through Oracle. The requirement is this: - Java based...
22
by: klenwell | last post by:
I'm in the process of refactoring the php code base I've amassed over the last few years into an object-oriented framework. I'm about to start in on the authentication/login extension and I've...
2
by: gangac | last post by:
I am currently working on an ms access application for a large insurance company which generates reports for the user after the user inputs/select some data.... Unfortunately the application has...
6
by: ulas | last post by:
Hi, This is a pretty basic question I guess but it is one that I cannot decide one way or another on so I thought I should consult people who know much more about databases than me :) So the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.