The following is an extension of the previous post.
This is useful when dealing with sql server 2005 and custom schema’s.
(That is the prefix before database objects, not the structure of the database).
select tableName=SO.name, schemaName = SS.Name
from sysobjects SO
join sys.schemas SS ON SO.uid = SS.[schema_id]
where type = ‘U’
order by SO.name