sql2005bat.bat
来自「数据库存储过程成千上百的的时候」· Batch 代码 · 共 211 行
BAT
211 行
@setlocal
@echo off
@set dbname=bank_dw
if not "%dbuser%" == "" goto gotdbuser
@set dbuser=sa
:gotdbuser
if not "%userpwd%" == "" goto gotuserpwd
@set userpwd=abcd
:gotuserpwd
if not "%dbserver%" == "" goto gotdbserver
@set dbserver=162.16.1.101
:gotdbserver
if not "%bcppath%" == "" goto gotbcppath
@set bcppath=C:\Program Files\Microsoft SQL Server\90\Tools\binn
:gotbcppath
@set mypath=%~dp0
echo 正在初始化数据中心%dbname%库存储过程:%mypath%
for /R "%mypath%" %%d in (*.sql) do if exist "%%d" echo %%~nd%%~xd & call "%bcppath%\osql.exe" -d %dbname% -S %dbserver% -i "%%d" -U %dbuser% -P %userpwd% -n
pause
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?