ramlicious Blogs by Tina & Prabhu

May 25, 2010

ExecSQL.bat that uses osql utility

Filed under: SQL Server — Prabhuram @ 4:10 am

Here is another easy batch file, which makes use of osql utility to execute a SQL file and to generate an output log file.


\>ExecSQL.bat [input sql file]


The above command generates an output file called input.sql.log in the patch where the input file resides. Change the contents of the batch file (ExecSQL.bat) when required:

@echo off
osql    -S (local)    -E     -d master    -n    -i %1    -o %1.log
ECHO Process Completed

I'm writing this just for me so that I can refer to this whenever necessary.

No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress