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

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

hasanali00
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?

regards

nr
SQLTeam MVY

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

hasanali00
Posting Yak Master

207 Posts

Posted - 05/17/2006 :  10:02:10  Show Profile  Reply with Quote
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

India
22754 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

Madhivanan

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

hasanali00
Posting Yak Master

207 Posts

Posted - 05/18/2006 :  04:40:20  Show Profile  Reply with Quote
beautiful
Go to Top of Page
  Previous Topic Topic Next Topic  
 New 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