That is not an entirely simple question to answer, since there are so many possibilities. It could be stored procedures, it could be ad-hoc statements from the client.
I have an article on my web site Where Is that Table Used? which discusses various approaches. You may to apply more than one of them.