Tuesday, March 21, 2006

Batch Execute .sql files in a directory

FOR %i IN (*.sql) DO OSQL -n -U sa -P sapassword -d databasename -i %i

or Use

COPY *.SQL AllSQL.sql
OSQL -n -E -i AllSQL.sql

No comments: