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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Export / Print table fields
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Posting Yak Master

207 Posts

Posted - 05/17/2006 :  08:50:48  Show Profile  Reply with Quote
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?



United Kingdom
12543 Posts

Posted - 05/17/2006 :  08:53:52  Show Profile  Visit nr's Homepage  Reply with Quote
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

Posting Yak Master

207 Posts

Posted - 05/17/2006 :  10:02:10  Show Profile  Reply with Quote

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?

Go to Top of Page

Premature Yak Congratulator

22864 Posts

Posted - 05/18/2006 :  03:04:06  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
Select table_name, Column_name from Information_Schema.Columns
Order by table_name, Column_name


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

Posting Yak Master

207 Posts

Posted - 05/18/2006 :  04:40:20  Show Profile  Reply with Quote
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000