| @ECHO off cls REM ECHO on REM Objective: To upload all the files in the folder to SQL server as a table REM Created by: MAK REM Date: Nov 3, 2004 REM Contact: mak_999@yahoo.com REM Check parameters if "%1"=="" Goto noparmErr if "%1"=="/?" Goto Help REM assign variables Date/t > %6 REM Export DIR listing to Dirlist.txt OSQL /S%2 /U%4 /P%5 /d%3 /Q "if exists (select * from %3.dbo.sysobjects OSQL /S%2 /U%4 /P%5 /d%3 /Q "create table %3.dbo. FOR /F "usebackq delims==" %%i in (Dirlist.txt) do OSQL
GOTo END2 :noparmErr
:Help :END :END2 |
upload.bat下载
2.把textcopy.Exe从Microsoft SQL Server\MSSQL\Binn目录拷贝到upload.bat同一目录。
3.运行upload.bat,参数如下:
![]() |
![]() |
| Select ID from Myuploadtable 01-2004-08-20-.wav Pfizer 12625.doc STARTSQL.bat status.bat STOPSQL.bat sysperfinfo.zip Tech Interview.xls Unix.bat Taiwan.zip select * from Myuploadtable |