数据库时间修改为今年.sql 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. use [28] -- 要修改的数据库;
  2. declare @olddt nvarchar(50)
  3. declare @newdt nvarchar(50)
  4. set @olddt = '2010' -- 现有数据库订单时间;
  5. set @newdt = '2009' -- 指定修改后的订单时间;
  6. set @olddt = '2011' -- 现有数据库订单时间;
  7. set @newdt = '2010' -- 指定修改后的订单时间;
  8. set @olddt = '2012' -- 现有数据库订单时间;
  9. set @newdt = '2011' -- 指定修改后的订单时间;
  10. set @olddt = '2013' -- 现有数据库订单时间;
  11. set @newdt = '2012' -- 指定修改后的订单时间;
  12. set @olddt = '2014' -- 现有数据库订单时间;
  13. set @newdt = '2013' -- 指定修改后的订单时间;
  14. set @olddt = '2015' -- 现有数据库订单时间;
  15. set @newdt = '2014' -- 指定修改后的订单时间;
  16. update bakstate set date = replace(date, @olddt, @newdt)
  17. update burncdreg set date = replace(date, @olddt, @newdt)
  18. update client set id = replace(id, @olddt, @newdt)
  19. update client2 set date = replace(date, @olddt, @newdt)
  20. update client2phonerecord set datetime = replace(datetime, @olddt, @newdt)
  21. update client2phonerecordout set datetime = replace(datetime, @olddt, @newdt)
  22. update client3 set date = replace(date, @olddt, @newdt)
  23. update client3phonerecord set datetime = replace(datetime, @olddt, @newdt)
  24. update client3phonerecordout set datetime = replace(datetime, @olddt, @newdt)
  25. update digitalwork set
  26. date1 = replace(date1, @olddt, @newdt)
  27. ,date2 = replace(date2, @olddt, @newdt)
  28. ,date3 = replace(date3, @olddt, @newdt)
  29. ,id = replace(id, @olddt, @newdt)
  30. update dindan set
  31. time1 = replace(time1, @olddt, @newdt)
  32. ,time2 = replace(time2, @olddt, @newdt)
  33. ,time3 = replace(time3, @olddt, @newdt)
  34. ,time4 = replace(time4, @olddt, @newdt)
  35. ,time5 = replace(time5, @olddt, @newdt)
  36. ,time6 = replace(time5, @olddt, @newdt)
  37. ,time7 = replace(time7, @olddt, @newdt)
  38. ,time8 = replace(time8, @olddt, @newdt)
  39. ,time9 = replace(time9, @olddt, @newdt)
  40. ,time10 = replace(time10, @olddt, @newdt)
  41. ,taketime = replace(taketime, @olddt, @newdt)
  42. ,payed3time = replace(payed3time, @olddt, @newdt)
  43. ,payed4time = replace(payed4time, @olddt, @newdt)
  44. ,datetime4 = replace(datetime4, @olddt, @newdt)
  45. ,datetime5 = replace(datetime5, @olddt, @newdt)
  46. ,datetime6 = replace(datetime6, @olddt, @newdt)
  47. ,xplrtime = replace(xplrtime, @olddt, @newdt)
  48. ,id = replace(id, @olddt, @newdt)
  49. update dindanbukuan set
  50. date = replace(date, @olddt, @newdt)
  51. ,id = replace(id, @olddt, @newdt)
  52. update dindanbukuan2 set
  53. date = replace(date, @olddt, @newdt)
  54. ,id = replace(id, @olddt, @newdt)
  55. update dindanjd set
  56. date = replace(date, @olddt, @newdt)
  57. ,inputtime = replace(inputtime, @olddt, @newdt)
  58. ,id = replace(id, @olddt, @newdt)
  59. update dindansp set
  60. date1 = replace(date1, @olddt, @newdt)
  61. ,date2 = replace(date2, @olddt, @newdt)
  62. ,date3 = replace(date3, @olddt, @newdt)
  63. ,date4 = replace(date4, @olddt, @newdt)
  64. ,hqdate = replace(hqdate, @olddt, @newdt)
  65. ,id = replace(id, @olddt, @newdt)
  66. update dindansp2 set
  67. date = replace(date, @olddt, @newdt)
  68. ,id = replace(id, @olddt, @newdt)
  69. update dresshire set
  70. date = replace(date, @olddt, @newdt)
  71. ,date1 = replace(date1, @olddt, @newdt)
  72. ,date2 = replace(date2, @olddt, @newdt)
  73. ,id = replace(id, @olddt, @newdt)
  74. update dresshiredata set
  75. returndate = replace(returndate, @olddt, @newdt)
  76. ,date1 = replace(date1, @olddt, @newdt)
  77. ,date2 = replace(date2, @olddt, @newdt)
  78. ,id = replace(id, @olddt, @newdt)
  79. update dressinfo set
  80. date = replace(date, @olddt, @newdt)
  81. update employeephonerecord set
  82. datetime = replace(datetime, @olddt, @newdt)
  83. update employeephonerecordout set
  84. datetime = replace(datetime, @olddt, @newdt)
  85. update fixedassets set
  86. date = replace(date, @olddt, @newdt)
  87. update gudingfeiyong set
  88. dat = replace(dat, @olddt, @newdt)
  89. update hospitalclient set
  90. date1 = replace(date1, @olddt, @newdt)
  91. ,inputdate = replace(inputdate, @olddt, @newdt)
  92. ,id = replace(id, @olddt, @newdt)
  93. update hospitalclientcontactreg set
  94. bookingdate = replace(bookingdate, @olddt, @newdt)
  95. ,alarmdate = replace(alarmdate, @olddt, @newdt)
  96. ,id = replace(id, @olddt, @newdt)
  97. update insidemsg set
  98. timestamp = replace(timestamp, @olddt, @newdt)
  99. update log set
  100. date = replace(date, @olddt, @newdt)
  101. update loginsign set
  102. date = replace(date, @olddt, @newdt)
  103. update lonindata set
  104. datetime = replace(datetime, @olddt, @newdt)
  105. update membercard2 set
  106. date = replace(date, @olddt, @newdt)
  107. update mywork set
  108. datetime = replace(datetime, @olddt, @newdt)
  109. ,inputdate = replace(inputdate, @olddt, @newdt)
  110. ,id = replace(id, @olddt, @newdt)
  111. update singleincome set
  112. dat = replace(dat, @olddt, @newdt)
  113. update singleincomemoney set
  114. date = replace(date, @olddt, @newdt)
  115. update sendreg set
  116. timestamp = replace(timestamp, @olddt, @newdt)