verdbtbl.bat 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. if "%3"=="" goto Usage
  2. set DBTABLETEMP=%TEMP%\verdbtbl.err
  3. set DBTABLELOG=%LOGDIR%\verdbtbl.err
  4. if exist %DBTABLETEMP% del %DBTABLETEMP%
  5. rem
  6. rem The first step is to make sure we have one or more records in
  7. rem every table.
  8. rem
  9. set ISQL=isql.exe -S %2 -E -d %3 -n -e
  10. set QUERY=-Q "select COUNT(*) from %%t"
  11. for %%t in ( afterburners, alephdef, alephinstances, ammo, attachpoints, characterinfo, civs, developments drones, effects ) DO %ISQL% %QUERY% >> %DBTABLETEMP%
  12. for %%t in ( globalattributes, magazines, missiles, objecttype, parts, parttypes, planetinstances, posterinstances ) DO %ISQL% %QUERY% >> %DBTABLETEMP%
  13. for %%t in ( projectiles, sectorinfo, shields, shipclasses, shiptypes, stationclasses, stationtypes, weapons ) DO %ISQL% %QUERY% >> %DBTABLETEMP%
  14. type %DBTABLETEMP% | awk -f %SCRIPTDIR%\verify\verdbtbl.awk > %DBTABLELOG%
  15. rem
  16. rem The filesize should be zero if everything went well.
  17. rem
  18. call %SCRIPTDIR%\util\filesize.bat %DBTABLELOG% FILESIZE
  19. if "%FILESIZE%"=="0" goto Success
  20. set BUILDERROR=1
  21. goto AfterCheck
  22. :Success
  23. echo No errors found. > %DBTABLELOG%
  24. goto AfterCheck
  25. :AfterCheck
  26. set DBTABLETEMP=
  27. set DBTABLELOG=
  28. set ISQL=
  29. set QUERY=
  30. set FILESIZE=
  31. goto End
  32. :Usage
  33. echo Usage: verdbbat [Build] [SQL Server] [SQL Database]
  34. set BUILDERROR=1
  35. goto End
  36. :End