Create two BAT files, create_all.bat and create_all_file.bat. The details are as follows:
Create_all.bat
Echo off
Set the following content for REM.
Rem set driver = D:
Rem set filepath = D:/mywork/SQL/
Set user_id = Andy
Set user_pwd = Andy
Set servername = andyserver
Set hostname = 172.23.9.27
Set dbname = Andy
Set next = ------------------------------------------
Set commandstr = iSQL-U % user_id %
Set commandstr = % commandstr %-P % user_pwd %
Set commandstr = % commandstr %-S % servername %
Set commandstr = % commandstr %-H % hostname %
Set commandstr = % commandstr %-D % dbname %
Set commandstr = % commandstr %-I % filepath %
REM % driver %
Rem cd % filepath %
Rem executes all SQL files in the specified directory
For % I in (*. SQL) Do call create_all_file.bat % I
The echo SQL file is executed successfully. Check the preceding execution result.
Pause
----------------------------------------------------------------
Create_all_file.bat
Set filename = % 1
Echo % 1
Set commandstrtb = % commandstr % filename %
Echo % commandstrtb %
% Commandstrtb %
Echo.
Echo % Next %
Usage:
1. Copy the preceding two files to the directory containing the SQL file;
2. Double-click the create_all.bat file.