REM Obs: a palavra-chave REM transforma um trecho num comentário dentro de um arquivo .bat

REM No Sql Server 2005 use:
REM set CAU_OSQLCOMMAND="%PROGRAMFILES%\Microsoft SQL Server\90\Tools\Binn\osql.exe"

REM No Sql Server 2008 use:
set CAU_OSQLCOMMAND="%PROGRAMFILES%\Microsoft SQL Server\100\Tools\Binn\osql.exe"


%CAU_OSQLCOMMAND% -E -S .\SQLExpress -i School.sql


REM osql -E -S .\SQLExpress -d School -Q "exec sp_grantlogin 'Programmer\Network Service'"
REM osql -E -S .\SQLExpress -d School -Q "sp_grantdbaccess 'Programmer\Network Service'"


REM %CAU_OSQLCOMMAND% "EXEC sp_addrolemember N'aspnet_Membership_FullAccess', N'Network Service'"

pause

exit

REM Se você usa a instância-padrão: substitua .\SQLExpress por (local)