恢复错误数据dindanjd.sql 998 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. --将db和备份数据存储在dindanjd_back中
  2. select [id]
  3. ,[name]
  4. ,[date]
  5. ,[time]
  6. ,[waiter1]
  7. ,[waiter2]
  8. ,[status]
  9. ,[waiter12]
  10. ,[waiter22]
  11. ,[bookingdate]
  12. ,[dress]
  13. ,[bz]
  14. ,[clerk]
  15. ,[inputtime]
  16. ,[branch] into [befupgrade].[dbo].[dindanjd_back]
  17. from [befupgrade].[dbo].[dindanjd]
  18. insert into [befupgrade].[dbo].[dindanjd_back]
  19. select [id]
  20. ,[name]
  21. ,[date]
  22. ,[time]
  23. ,[waiter1]
  24. ,[waiter2]
  25. ,[status]
  26. ,[waiter12]
  27. ,[waiter22]
  28. ,[bookingdate]
  29. ,[dress]
  30. ,[bz]
  31. ,[clerk]
  32. ,[inputtime]
  33. ,[branch] from [db].[dbo].[dindanjd_back2]
  34. --去除完全重复的记录;1163
  35. select distinct * into [befupgrade].[dbo].[dindanjd_back#]
  36. from [befupgrade].[dbo].[dindanjd_back]
  37. delete from [befupgrade].[dbo].[dindanjd_back#] where name='系统默认景点'
  38. drop table [db].[dbo].[dindanjd_back2]
  39. select * into [db].[dbo].[dindanjd_back2] from [befupgrade].[dbo].[dindanjd_back#]