Share via


How to export or copy a table's Field Names to a Text File?

Question

Tuesday, October 11, 2011 2:32 PM

I'm sure this is easy but I'll be darn't if I can see how to do it this morning.

Thanks for any help.

 

All replies (6)

Tuesday, October 11, 2011 2:45 PM ✅Answered

Try Database Tools - Documentor.


Tuesday, October 11, 2011 8:51 PM ✅Answered

This will return the field names from MSysObjects (substitute the table you want to get field names from):
SELECT MSysObjects.*
FROM MSysObjects
WHERE False;

If you save it as a query and then export the results of the query as a CSV file you will get a comma delimited list of field names.

http://www.saberman.com


Tuesday, October 11, 2011 3:59 PM

Thanks Karl.

To expand a little on the method that I used...

Tools - Documentor - Export

I exported it as a text file with minimum fields... (all I wanted was the names of the table fields)

Then imported it into word and cleaned it up there with Find and Replace.

Thanks again for the help.

 


Tuesday, October 11, 2011 9:53 PM

Thanks saberman. Good tip!

 


Monday, November 5, 2012 9:35 PM | 1 vote

Actually the easiest way to get this info is to open the table, copy the first row, paste it into Excel, delete the data leaving just the field names row. Then copy that row and Paste, Transpose. This, of course, assumes all you want is the field names.


Tuesday, May 15, 2018 7:20 AM

Rod, your idea works great.  - I copy the row into a text document.

Then I can use the field names when building SQL statements to make indexes for tables in SQL Server.

Thanks.

Ed.

Ed505