Access a database and get table names

Hello,

I need to modify my client's database(he is using SQL Server 2005). I have the connection string so that i can connect to the database.

Is there a way that i can learn the table names that the database has and  even the data types that the tables contain ?

Or do i have to ask my client to tell me the table names and the column types/names ?

It would make my life a lot easier if there was a sql query that will retrieve table information from a database.
parabellumAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
momi_sabagCommented:
you can directly query information_schema.tables for table information and information_schema.columns for columns information
0
codeclayCommented:
use --<ur db name here>

GO

--To get the Table names

select * from sysobjects

where xtype ='U'

--To get the Column names

select * from information_schema.columns

Where table_name like ''
0
tpi007Commented:
SELECT TABLE_CATALOG,TABLE_SCHEMA,TABLE_NAME,COLUMN_NAME,DATA_TYPE,ORDINAL_POSITION,COLLATION_NAME,IS_NULLABLE
FROM information_schema.columns
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2005

From novice to tech pro — start learning today.