dumptables.bat 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. @echo off
  2. if /i "%1" == "in" goto direction_ok
  3. if /i "%1" NEQ "out" goto usage
  4. :direction_ok
  5. set feddb=federation
  6. set feddbsrv=
  7. set feddbpw=
  8. rem check for specified database
  9. if /i "%2"=="/d" set feddb=%3%
  10. if /i "%4"=="/d" set feddb=%5%
  11. if /i "%6"=="/d" set feddb=%7%
  12. rem check for specified server
  13. if /i "%2"=="/s" set feddbsrv=/S%3%
  14. if /i "%4"=="/s" set feddbsrv=/S%5%
  15. if /i "%6"=="/s" set feddbsrv=/S%7%
  16. rem check for specified password
  17. if /i "%2"=="/p" set feddbpw=%3%
  18. if /i "%4"=="/p" set feddbpw=%5%
  19. if /i "%6"=="/p" set feddbpw=%7%
  20. rem ************************************************************
  21. rem This list is sorted in dependancy order.
  22. rem I.e. table X comes after all tables which table X depends on
  23. rem ************************************************************
  24. echo Dumping Effects
  25. bcp %feddb%..Effects %1 Effects.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  26. echo Dumping PartTypes
  27. bcp %feddb%..PartTypes %1 PartTypes.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  28. echo Dumping Parts
  29. bcp %feddb%..Parts %1 Parts.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  30. echo Dumping Expendables
  31. bcp %feddb%..Expendables %1 Expendables.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  32. echo Dumping Afterburners
  33. bcp %feddb%..Afterburners %1 Afterburners.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  34. echo Dumping Maps
  35. bcp %feddb%..Maps %1 Maps.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  36. echo Dumping SectorInfo
  37. bcp %feddb%..SectorInfo %1 SectorInfo.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  38. echo Dumping AlephInstances
  39. bcp %feddb%..AlephInstances %1 AlephInstances.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  40. echo Dumping ShipTypes
  41. bcp %feddb%..ShipTypes %1 ShipTypes.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  42. echo Dumping AttachPoints
  43. bcp %feddb%..AttachPoints %1 AttachPoints.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  44. echo Dumping CharacterInfo
  45. bcp %feddb%..CharacterInfo %1 CharacterInfo.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  46. echo Dumping Civs
  47. bcp %feddb%..Civs %1 Civs.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  48. echo Dumping StationTypes
  49. bcp %feddb%..StationTypes %1 StationTypes.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  50. echo Dumping Asteroids
  51. bcp %feddb%..Asteroids %1 Asteroids.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  52. echo Dumping PosterInstances
  53. bcp %feddb%..PosterInstances %1 PosterInstances.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  54. echo Dumping Projectiles
  55. bcp %feddb%..Projectiles %1 Projectiles.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  56. echo Dumping Shields
  57. bcp %feddb%..Shields %1 Shields.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  58. echo Dumping Weapons
  59. bcp %feddb%..Weapons %1 Weapons.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  60. echo Dumping Ammo
  61. bcp %feddb%..Ammo %1 Ammo.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  62. echo Dumping Drones
  63. bcp %feddb%..Drones %1 Drones.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  64. echo Dumping Missiles
  65. bcp %feddb%..Missiles %1 Missiles.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  66. echo Dumping Magazines
  67. bcp %feddb%..Magazines %1 Magazines.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  68. echo Dumping Developments
  69. bcp %feddb%..Developments %1 Developments.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  70. echo Dumping GlobalAttributes
  71. bcp %feddb%..GlobalAttributes %1 GlobalAttributes.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  72. echo Dumping TechBits
  73. bcp %feddb%..TechBits %1 TechBits.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  74. echo Dumping StationClasses
  75. bcp %feddb%..StationClasses %1 StationClasses.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  76. echo Dumping ShipClasses
  77. bcp %feddb%..ShipClasses %1 ShipClasses.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  78. echo Dumping Cloaks
  79. bcp %feddb%..Cloaks %1 Cloaks.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  80. echo Dumping Probes
  81. bcp %feddb%..Probes %1 Probes.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  82. echo Dumping Mines
  83. bcp %feddb%..Mines %1 Mines.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  84. echo Dumping MineInstances
  85. bcp %feddb%..MineInstances %1 MineInstances.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  86. echo Dumping TreasureSets
  87. bcp %feddb%..TreasureSets %1 TreasureSets.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  88. echo Dumping TreasureChances
  89. bcp %feddb%..TreasureChances %1 TreasureChances.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  90. echo Dumping TreasureInstances
  91. bcp %feddb%..TreasureInstances %1 TreasureInstances.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  92. echo Dumping Chaff
  93. bcp %feddb%..Chaff %1 Chaff.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  94. echo Dumping StationInstances
  95. bcp %feddb%..StationInstances %1 StationInstances.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  96. echo Dumping ProbeInstances
  97. bcp %feddb%..ProbeInstances %1 ProbeInstances.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  98. echo Dumping CharMedals
  99. bcp %feddb%..CharMedals %1 CharMedals.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  100. echo Dumping CharStats
  101. bcp %feddb%..CharStats %1 CharStats.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  102. echo Dumping Medals
  103. bcp %feddb%..Medals %1 Medals.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  104. echo Dumping Ranks
  105. bcp %feddb%..Ranks %1 Ranks.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  106. echo Dumping Constants
  107. bcp %feddb%..Constants %1 Constants.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  108. echo Dumping AccessCodes
  109. bcp %feddb%..AccessCodes %1 AccessCodes.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  110. echo Dumping AccessCodeUsage
  111. bcp %feddb%..AccessCodeUsage %1 AccessCodeUsage.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  112. echo Dumping PSSInstances
  113. bcp %feddb%..PSSInstances %1 PSSInstances.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  114. echo Dumping Squads
  115. bcp %feddb%..Squads %1 Squads.dat /c /E /Usa %feddbsrv% /P%feddbpw%
  116. goto end
  117. :usage
  118. rem 12345678911234567892123456789312345678941234567895123456789612345678971234567898
  119. echo .
  120. echo Usage: dumptables Direction [/S Server] [/P Password] [/D Database]
  121. echo .
  122. echo Where: Direction is {in^|out} (in = from file to database, out = from
  123. echo database to file).
  124. echo Server is machine of database you want to use, so you can use
  125. echo dumptables from a machine other than the one the database is on
  126. echo Password is the password for the sa account
  127. echo Database is the name of the SQL database to use
  128. echo .
  129. echo Notes: * You must leave a space between all switches and their values
  130. echo * All parameters in brackets are optional, and may appear in any order
  131. echo * Password only matters if server doesn't use trusted connections
  132. echo .
  133. echo Example: dumptables in /S fedsrv /P mypassword
  134. echo .
  135. :end