Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 How to see all columns of all tables in a database

Author  Topic 

Ach
Starting Member

13 Posts

Posted - 2005-09-10 : 05:35:57
Hi,
I want to know is there any way to see all tablenames and column names using a quiey on database or system catalog?I have seen some solutions such as "sp_columns <table_name>" or some other regarding syscolumns table and join it with sysobjects.But none of them can be used to list the followin report:
table_name column_name
------------------------
jobs job_id
jobs job_desc
jobs min_lvl
jobs max_lvl

-Thanks in advance

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-09-10 : 06:11:32
Select table_name, Column_name from information_Schema.columns
order by table_name

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -