Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Excel-to-DB in a batch file

Status
Not open for further replies.

papillonNpig

Computer
Oct 6, 2005
2
I have a select statement that works in Query Analyzer.

SELECT * INTO TableName FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 8.0;Database=drive:\DirName\FileName.xls', [SheetName$])

Can I put it in a batch file? Just tried the isql command,

isql -S"Servername" -d DBname -E /Q "<The select statement>"

didn't work. Any suggestions?

 
Replies continue below

Recommended for you

I already figured out! Put the script in a .sql file, then use the isqlw command. Thanks for reading :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor