Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I import excel file to table on SQL server 6.5?

Status
Not open for further replies.

a23

Programmer
Nov 2, 2000
1
CA
how can i import excel file to table on SQL server??
thanks
 
A23, We load excel files into SQL every month, but I convert them to a comma delimited format (CSV), rename them to a filetype of .TXT (otherwise it still thinks it is excel). Then I have a .FMT file that outlines all of the fields:
6.0
1
1 SYBCHAR 0 4 "," 1 ARCHIVE_YEAR

and then I use a bulk copy command (requires bcp.exe) from dos (can be set up in a batch exec also):
bcp dbname..dbtable in MYEXCEL.TXT -f formatfilename.FMT -U userid -P password -S servernm

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top