SET database=%1
SET server=%2
if "%3" == "NT" goto NTOptions
SET userflags=-U %4 -P %5
SET bcpflags=-U %4 -P %5
goto start

:NTOptions
SET bcpflags=-T
SET userflags=-E


:start

@echo.
@echo. Dropping previous DataBase and user
@echo.

osql -S %server% %userflags% -b -Q "killspid [%database%]"
osql -S %server% %userflags% -b -Q "if exists (SELECT name FROM master.dbo.sysdatabases WHERE name = N'%database%') drop database [%database%]"
osql -S %server% %userflags% -b -Q "sp_droplogin '%database%_login'"