12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- -- 将订单从历史数据库里还原到当前数据库;
- use [2013]
- select * from client where id = '20130813-003'
- select * from dindan where id = '20130813-003'
- select * from dindanjd where id = '20130813-003'
- select * from dindansp where id = '20130813-003'
- select * from dindansp2 where id = '20130813-003'
- select * from dindansp3 where id = '20130813-003'
- --select * from dindanbukuan where id = '20130813-003'
- --select * from dindanbukuan2 where id = '20130813-003'
- select * from burncdreg where id = '20130813-003'
- select * from digitalwork where id = '20130813-003'
- select * from mywork where id = '20130813-003'
- select * from photoprint where id = '20130813-003'
- -----------------------------
- --将某个订单从历史数据库中还原到当前数据库中;
- insert into [db].[dbo].[client] select * from [2013].[dbo].[client] where id = '20130813-003'
- insert into [db].[dbo].[dindan] select * from [2013].[dbo].[dindan] where id = '20130813-003'
- insert into [db].[dbo].[dindanjd] select * from [2013].[dbo].[dindanjd] where id = '20130813-003'
- insert into [db].[dbo].[dindansp]([id],[spid],[shuliang],[kind],[price]
- ,[name],[no],[status1],[status2],[status3]
- ,[status4],[date1],[date2],[date3],[date4],[name1]
- ,[name2],[name3],[name4],[hqdate],[hqtime],[urgent]
- ,[taketime],[no2],[status5],[status6],[date5],[date6],[name5]
- ,[name6],[growthtxname],[ps],[zs],[ren1],[ren2],[hqstatus],[bz] )
- select [id],[spid],[shuliang],[kind],[price]
- ,[name],[no],[status1],[status2],[status3]
- ,[status4],[date1],[date2],[date3],[date4],[name1]
- ,[name2],[name3],[name4],[hqdate],[hqtime],[urgent]
- ,[taketime],[no2],[status5],[status6],[date5],[date6],[name5]
- ,[name6],[growthtxname],[ps],[zs],[ren1],[ren2],[hqstatus],[bz] from [2013].[dbo].[dindansp] where id = '20130813-003'
- insert into [db].[dbo].[dindansp2] select * from [2013].[dbo].[dindansp2] where id = '20130813-003'
- insert into [db].[dbo].[dindansp3] select * from [2013].[dbo].[dindansp3] where id = '20130813-003'
- insert into [db].[dbo].[dindanbukuan]([id],[money],[ren],[date],[bz],[kind],[ren2],[item],[paytype],[jdd],[financecheck],[discount],[time])
- select [id],[money],[ren],[date],[bz],[kind],[ren2],[item],[paytype],[jdd],[financecheck],[discount],[time]
- from [2013].[dbo].[dindanbukuan] where id = '20130813-003'
- insert into [db].[dbo].[dindanbukuan2]([id],[money],[ren],[date],[bz],[kind],[ren2])
- select [id],[money],[ren],[date],[bz],[kind],[ren2]
- from [2013].[dbo].[dindanbukuan2] where id = '20130813-003'
- insert into [db].[dbo].[burncdreg] select * from [2013].[dbo].[burncdreg] where id = '20130813-003'
- insert into [db].[dbo].[digitalwork] select * from [2013].[dbo].[digitalwork] where id = '20130813-003'
- insert into [db].[dbo].[mywork] select * from [2013].[dbo].[mywork] where id = '20130813-003'
- insert into [db].[dbo].[photoprint] select * from [2013].[dbo].[photoprint] where id ='20130813-003'
- --将历史数据库中的全部订单还原到当前数据库中;
- insert into [db].[dbo].[client] select * from [2013].[dbo].[client]-- where id = '20130813-003'
- insert into [db].[dbo].[dindan] select * from [2013].[dbo].[dindan]-- where id = '20130813-003'
- insert into [db].[dbo].[dindanjd] select * from [2013].[dbo].[dindanjd]-- where id = '20130813-003'
- insert into [db].[dbo].[dindansp]([id],[spid],[shuliang],[kind],[price]
- ,[name],[no],[status1],[status2],[status3]
- ,[status4],[date1],[date2],[date3],[date4],[name1]
- ,[name2],[name3],[name4],[hqdate],[hqtime],[urgent]
- ,[taketime],[no2],[status5],[status6],[date5],[date6],[name5]
- ,[name6],[growthtxname],[ps],[zs],[ren1],[ren2],[hqstatus],[bz] )
- select [id],[spid],[shuliang],[kind],[price]
- ,[name],[no],[status1],[status2],[status3]
- ,[status4],[date1],[date2],[date3],[date4],[name1]
- ,[name2],[name3],[name4],[hqdate],[hqtime],[urgent]
- ,[taketime],[no2],[status5],[status6],[date5],[date6],[name5]
- ,[name6],[growthtxname],[ps],[zs],[ren1],[ren2],[hqstatus],[bz] from [2013].[dbo].[dindansp]-- where id = '20130813-003'
- insert into [db].[dbo].[dindansp2] select * from [2013].[dbo].[dindansp2]-- where id = '20130813-003'
- insert into [db].[dbo].[dindansp3] select * from [2013].[dbo].[dindansp3] --where id = '20130813-003'
- insert into [db].[dbo].[burncdreg] select * from [2013].[dbo].[burncdreg] --where id = '20130813-003'
- insert into [db].[dbo].[digitalwork] select * from [2013].[dbo].[digitalwork] --where id = '20130813-003'
- insert into [db].[dbo].[mywork] select * from [2013].[dbo].[mywork] --where id = '20130813-003'
- insert into [db].[dbo].[photoprint] select * from [2013].[dbo].[photoprint] --where id ='20130813-003'
|