During my Yukon/Whidbey testing, one the the bugs i filed was that "Create Command File" was missing from the VS.NET IDE.
I'd found this to be a useful helper, where it would create a command file (.cmd) from the SQL scripts in my database project.
In the November CTP, there's no support for database projects, but they've also said that "Create Command File" has been removed.
This was somewhat of a pain, since there's really no good way to execute directories of scripts easily.
So, today i decided to finally whip together a little .cmd file of my own that would recurse thru a directory path, and run 'osql' on the scripts in there.
Whew! What a relief... finally an easy way to zip thru all my scripts and update all the stored procedures at once.
@echo off
REM: Usage: RunScripts [Path] [Server] [Database]
if '%1' == '' goto usage
if '%2' == '' goto usage
if '%3' == '' goto usage
if '%1' == '/?' goto usage
if '%1' == '-?' goto usage
if '%1' == '?' goto usage
if '%1' == '/help' goto usage
ECHO Path: %1
ECHO Server: %2
ECHO Database: %3
for /r %1 %%f in (*.sql) DO osql -S "%2" -d "%3" -E -b -i "%%f"
goto finish
REM: How to use screen
:usage
echo.
echo Usage: RunScripts Server Database
echo Server: the name of the target SQL Server
echo Database: the name of the target database
echo.
echo Example: RunScripts Path MainServer MainDatabase
echo.
echo.
goto done
REM: finished execution
:finish
echo.
echo Script execution is complete!
:done
pause
@echo on