Re: How to find which tables are populated with data
Posted in 1997
Topics: Stored Procedures & SPL, Server Administration
HI:
David MacAllister wrote:
}
} Hello
} I need a little help as I'm very new to the DBA game!!!!
}
} Is there a sql statement by which I can select tables on a particular
} database to see if they are populated with data ?
}
} I've tried
} select * from systabnames
} where dbsname = 'testdb'
}
} This has returned the system tables as well as tables on my 'testdbs' but
} does
} not state whether they are populated with data.
Try:
1) Open the database where the tables are
database YOUR_DATABASE
2 ) Run update statistics.
update statistics;
3)then try.
select tabname,nrows from systables
where tabid >99 and tabtype ="T"
This will return all the tables with the number of rows that
each one has.
}
} Also, I've been dropping stored procedures individually, with similar
} prefix ie
} address_a, address_b, address_c, agent_a, agent_u, agent_s1 etc.
}
} Is there a way that I can select these and then drop them all at the same
} time?
Try:
Select "drop procedure ",procname,";"
FROM sysprocedures
where procname matches "YOUR_PREFIX*"
Save the output into a file and run the file as a set of SQL commands.
Be careful to review the file and verify that **only** the stored
procedures that you want to drop are listed there.
} TIA
}
} David
Tino