Folks,
I have a peculiar reqest from mgmt, namely, to come up w/ a "report" ("even if it's just an excel list") that will step through every field in every table in our Remedy DB to see which of the fields are not being used.
I know, strange, and ... a "bad" use of resources -- but I still have to get something done. It would be a run-once thing, and I am hoping someone can help me come up w/ a method.
I've got a stored procedure that will do a "foreachtable", and I can force it to just use the specific views we need... but I haven't come up w/ a good way to detect "not used" OR how to force that into a nested query... kind of like
sp_foreachtable do
for each column
select columnname, count(null) from column
I could really used suggestions both on how to get the above, as well as IS that the best (only) way to test for not used? What I'd like to wind up with would be checking for null, as well as "blank" or "empty" -- because there are no rules on what they put in these fields. MOST fields WILL be used, so I may wind up using any output as input to Crystal Reports, and pretty it up. I'd love to get an output like...
Group: Tablename, #_rows
Detail: columnname, #_null, #_blank_or_empty
and I am hoping that when processing in Crystal, I can use the #_null/ #_rows and #_blank_or_empty / #_rows to suppress any fields that look like they are actually being used.
Whew. Anybody? Any ideas?
Marc
--
Marc Visconte
CSC
Lead RMS Developer
Crystal Reports
I have a peculiar reqest from mgmt, namely, to come up w/ a "report" ("even if it's just an excel list") that will step through every field in every table in our Remedy DB to see which of the fields are not being used.
I know, strange, and ... a "bad" use of resources -- but I still have to get something done. It would be a run-once thing, and I am hoping someone can help me come up w/ a method.
I've got a stored procedure that will do a "foreachtable", and I can force it to just use the specific views we need... but I haven't come up w/ a good way to detect "not used" OR how to force that into a nested query... kind of like
sp_foreachtable do
for each column
select columnname, count(null) from column
I could really used suggestions both on how to get the above, as well as IS that the best (only) way to test for not used? What I'd like to wind up with would be checking for null, as well as "blank" or "empty" -- because there are no rules on what they put in these fields. MOST fields WILL be used, so I may wind up using any output as input to Crystal Reports, and pretty it up. I'd love to get an output like...
Group: Tablename, #_rows
Detail: columnname, #_null, #_blank_or_empty
and I am hoping that when processing in Crystal, I can use the #_null/ #_rows and #_blank_or_empty / #_rows to suppress any fields that look like they are actually being used.
Whew. Anybody? Any ideas?
Marc
--
Marc Visconte
CSC
Lead RMS Developer
Crystal Reports