@echo off

cd %cd%

set dbServer=.
set dbAcount=sa
set dbPass=123
set gameuser=game_user
set gamepass=123
set gameName=Kd
set dbpath=%cd%\Data

@echo ò£
@echo     [dbServer] ݿ:%dbServer%
@echo     [dbAcount] ɴݿʺ(sa):%dbAcount%
@echo     [dbPass]   ɴݿ(sa):%dbPass%
@echo     [gameuser] Ϸ¼ʺ:%gameuser%
@echo     [gamepass] Ϸ¼:%gamepass%
@echo     [gameName] ϷĿ:%gameName%
@echo     [dbpath] ݿ洢·:%dbpath%
@echo ================================================================

MD %dbpath%

Sqlcmd -? 2>nul 1>nul
if errorlevel 1 (
echo 밲װsqlcmd֧֡&pause>nul
exit
)

Sqlcmd -S %dbServer% -U %dbAcount% -P %dbPass% -d master -i Ϸʺ.sql -v gameuser="%gameuser%" loginPass="%gamepass%"
@echo ݿ¼ʺųɹ!

Sqlcmd -S %dbServer% -U %dbAcount% -P %dbPass% -d master -i ûıṹ.sql -v gameuser="%gameuser%" dbpath="%dbpath%" 
@echo ڴûݿɹ!

Sqlcmd -S %dbServer% -U %dbAcount% -P %dbPass% -d master -i ֵַıṹ.sql -v gameuser="%gameuser%" dbpath="%dbpath%" 
@echo ֵַݿɹ!

@echo ڴϷ%4ݿ...
Sqlcmd -S %dbServer% -U %dbAcount% -P %dbPass% -d master -i Ϸݿ.sql -v gameuser="%gameuser%" gameName="%gameName%" dbpath="%dbpath%"


@echo ڳʼϷ...
Sqlcmd -S %dbServer% -U %dbAcount% -P %dbPass% -d master -i ÿݵ.sql -v gameName="%gameName%"

@echo ִгɹ

ECHO н& PAUSE

