Like I said in my earlier post OSQL is very useful to run sql scripts and run queries.This post demonstrates the use of OSQL in running all the scripts in a given folder.
:: Keep variables local
:: Check command line arguments
IF NOT DEFINED Server
IF NOT DEFINED Database GOTO Syntax
IF DEFINED Test GOTO Syntax
:: Execute sql scriptsFOR %%f IN (*.sql)
:: ECHO Running script %%f... ECHO ^>^> %%f
OSQL -E -S %1 -d %2 -n -m-1 -b -i "%%f"
IF ERRORLEVEL 1
ECHO ^>^> Critcal error in script %%f! Ending execution.
:: Display complete message
ECHO Finished running sql scripts on database %2
ECHO Usage: RunSQLScripts server database scriptpath
Friday, January 30, 2009
OSQL - Running all the SQL Scripts in a given folder
IIS Manager Crashes on Start Windows 7, IIS 7.5, Power Shell 5.1. Here is the error I got in the event viewer. IISMANAGER_CRASH IIS Ma...
Update: 1/27/2013 I have got a very good response and feedback for the tool, I am working on the new version of it and soon will be relea...
If you have played with or is using System.DirectoryServices.ActiveDirectory, you might jump into the consclusio that "DirectorySearche...
Failed to open the connection. Details: [Database Vendor Code: 4060 ] Failed to open the connection. temp_62a7065e-b077-44f0-8593-7dca04303...