February 19, 2008 at 5:16 am
Hello
How to identify the fields without use, in one or many tables?
One of the ways to improve the performance and qwerys, is the proper dimension of database and his tables.
In giant tables, when you remove a field without use, can make the difference.
is not only enough to make select * table and visually to identify the fields without any contents.
I want (if possivel) a TSQL that analyzes all the tables of a database and returns one report or table with this empty fields.
Thanks
Jorge
February 20, 2008 at 2:58 pm
I'm not really sure if what you are looking for is possible in a single query.
Part of the problem is that it doesn't just matter if the field is empty (and by empty do you mean null? or '') it also matters if any of your sql code touches that column or for that matter if any application touches it. If the column was used at one point and is still referenced in an application using your database you could crash the application by removing the column. And there is certainly no easy t-sql way to check for that.
Sorry if I couldn't be more positive.
Kenneth
Kenneth FisherI was once offered a wizards hat but it got in the way of my dunce cap.--------------------------------------------------------------------------------For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/[/url]Link to my Blog Post --> www.SQLStudies.com[/url]
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply