Click here to Skip to main content
12,998,363 members (57,834 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I have interesting task. We are using a bunch of tables filled with data we don’t use anymore. Problem is I don’t have documentation for applications used in the past with our SQL Server tables so I must manually locate unused column data. Is there some tool out there to do this job for me?
Posted 10-May-13 18:15pm
This is fully depends on your definition of "use".
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I think that, given enough time, I could proof that in general case this is theoretically impossible. But I can give you the idea:[^].

Are you getting the picture? You may have some "dead code" in your application, which uses some columns but is never actually called. It is theoretically impossible to proof that it is called (or not), which can be proven as a consequence of halting problem. Practically, this is even harder.

In principle, you could do much weaker statements: you could eliminate the columns with names which are not hard-coded in the product. In other words, it can help only some sloppy products and still cannot 100% guarantee that the functionality is not broken. And I would not expect that anyone would be developing a tool like that.

Rate this: bad
Please Sign up or sign in to vote.

Solution 2

I agree it is almost impossible.If you have queries like select * used in your application than you cant just go and delete data ....
First you need to examine your application code. This can be time consuming, but it is a good place to start. Finding all references for each column...
You can do a profiling for tables you want to clean. Just let it run few days and than examine logs.

The only tool i know for this is[^]
It can find all "orphan" objects.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170622.1 | Last Updated 12 May 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100