Execute All SQL Files in a Directory
SCRIPT #1
-----------------------------------------------------------
FORFILES /S /M *.sql /C "cmd /C sqlcmd -S HYD2CFETDWDEV2 -d TaxWarehouse -b -i @file >> ..\Log1.txt"
SCRIPT #2
------------------------------------------------------------
SET DWServer = %1
for /r "D:\TaxWarehouse\Tables\" "%X" in (*.sql) do sqlcmd -S DWServer -d TaxWarehouse -b -i %X
--DB
No comments:
Post a Comment