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 cowski 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
Joined
Oct 6, 2005
Messages
2
Location
US
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?

 
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

Back
Top