Easy way to create INSERT for table with hundreds of columns?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there any easy way to create an INSERT statement for a table with hundreds
of columns?
I need to append the data in one table to another table. There are about 200
columns and I need to reformat about 150 of them since they are dates in text
format.
 
When I have to do something like this I get a list of the field names by
using this in the Immediate pane:

For j = 0 to 254: ?CurrentDB.TableDefs("XXX").Fields(j).Name : Next

Or if you export the table to Word Mailmerge format, Access will create
a schema.ini file in the same folder: this includes a list of field
names and types.

After that, I paste the list of fields into a text editor and use a mix
of typing, copying and search and replacing to convert it into a SQL
statement.
 
Back
Top