June 22, 2010 at 7:04 am
How to get those tables in which there is no any data and each tables have some constraints.
and we want to delete those tables from the database.
June 22, 2010 at 8:02 am
just because a table has no rows does not mean that table has not been referenced by a view/stored proc / function or external application; it is perfectly normal to have tables that are empty until they are actually used.
how do you KNOW the table is not being used? you have to sift through source code to be sure. This would be doubly true if a constraint exists on the table...if someone went to the trouble to add constraints or foreign keys, clearly there is some logic tied to the table, so it's very doubtful it should be removed jsut because it has no rows.
there is a similar thread where someone wanted to know how to determine if a table has not been used recently so it can be removed.
check out the many smart comments on that thread, as it pertains to your situation as well.
http://www.sqlservercentral.com/Forums/Topic940111-391-1.aspx
Lowell
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply