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 Development (2000)
 Export / Print table fields

Author  Topic 

hasanali00
Posting Yak Master

207 Posts

Posted - 2006-05-17 : 08:50:48
I am told to print all the Fields of my tables in alphabetical order.

Can this be achieved? Can I export all the table fields into Word document?

regards

nr
SQLTeam MVY

12543 Posts

Posted - 2006-05-17 : 08:53:52
select name from syscolumns where id = object_id('mytable') order by name


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

hasanali00
Posting Yak Master

207 Posts

Posted - 2006-05-17 : 10:02:10
Thanks.

Would I have to run this command for each table, or is there any easier way to return ALL the fields of ALL the tables in one go?

regards
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-05-18 : 03:04:06
Select table_name, Column_name from Information_Schema.Columns
Order by table_name, Column_name

Madhivanan

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

hasanali00
Posting Yak Master

207 Posts

Posted - 2006-05-18 : 04:40:20
beautiful
Go to Top of Page
   

- Advertisement -