测试版本库,随便折腾。
陈炜
2021-01-26 d717ddd0d4e6e954f7d7f64b7797f28e8806152f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
--µ¥¾Ý
truncate table  QMSaleCkRequest 
truncate table QMSaleCkRequestEntry
truncate table QMINQCReq    
truncate table QMINQCReqEntry
truncate table ICQCBill 
truncate table QMSourceInfo
truncate table PPOrder
truncate table  PPOrderEntry
truncate table  ICExpenses
truncate table  ICExpensesEntry
truncate table  ICInvBackup
truncate table ICQCScheme   
truncate table ICQCSchemeEntry
--¹Ì¶¨×ʲú
truncate table T_FACard 
truncate table T_FACardItem
truncate table T_FADevice
truncate table T_FAOrgFor 
truncate table T_FADept 
truncate table T_FAExpense
truncate table t_FAPurchase 
truncate table T_FAbalCard 
truncate table T_FAbalCardItem
truncate table T_FAbalDevice
truncate table T_FAbalOrgFor 
truncate table T_FAbalDept 
truncate table T_FAbalExpense
truncate table t_FAbalPurchase 
truncate table t_FAVoucher
truncate table t_FAClear
DELETE FROM  T_FAAlter
DELETE FROM  t_FAbalance
truncate table  t_RP_NewReceiveBill
truncate table t_RP_Contact
truncate table t_rp_ARBillOfSH
truncate table  t_rp_AdjustAccount
truncate table  t_rp_AdjustRate
truncate table  t_rp_AdjustRateEntry
truncate table  t_rp_ARBillOfSH
truncate table  t_RP_ARPBill
truncate table  t_rp_arpbillEntry
truncate table  t_rp_BegData
truncate table  t_rp_BegDataEntry
truncate table  t_RP_Bill
truncate table  t_rp_bill_discount
truncate table  t_RP_Bill_Endorse
truncate table  t_RP_Bill_Settle
truncate table  t_Rp_CheckDetail
truncate table  t_rp_CheckDetail20120517134445300
truncate table  t_rp_CheckEntry
truncate table  t_RP_Contact
truncate table  t_RP_ContactBal
truncate table  t_rp_ContractPlanReceive
truncate table  t_RP_NewReceiveBill
truncate table  t_rp_PayApplyBill
truncate table  t_rp_PayApplyBillEntry
truncate table  t_RP_Plan_Ap
truncate table  t_RP_Plan_Ar
truncate table  t_RPContract
truncate table  t_rpContractEntry
truncate table  t_RPContractScheme
truncate table  t_RPVoucherAndBill
truncate table  t_RP_NewCheckInfo
DELETE FROM t_Item_3003
DELETE FROM t_Item_3004
DELETE FROM t_Item_3005
DELETE FROM t_Item_3006
DELETE FROM t_Item_3009
truncate table ICStockBill
truncate table ICPlanAdjPrice
truncate table POrequest
truncate table POOrder
truncate table POInstock
truncate table POInstock
truncate table ICPurchase
truncate table  ICSale
truncate table SEOrder
truncate table SEOutStock
truncate table PORFQ
truncate table ICMO
truncate table ICSale
truncate table t_Voucher
truncate table t_Voucherentry
truncate table ICStockBill
truncate table ICStockBillEntry
truncate table ICPlanAdjPriEntry
truncate table POrequestEntry
truncate table POOrderEntry
truncate table POInstockEntry
truncate table ICPurchaseEntry
truncate table ICSaleEntry
truncate table SEOrderEntry
truncate table SEOutStockEntry
truncate table PORFQEntry
truncate table ppbom
truncate table ICSTJGBill
truncate table ICSTJGBillEntry
truncate table POInventory
truncate table ICChange                                                                 
truncate table ICChangeEntry  
truncate table ICMOChange                                                                      
truncate table ICMOChangeEntry
truncate table PPBomChange                                                                     
truncate table PPBomChangeEntry  
truncate table PPBOMEntry   
truncate table ICitemScrap                                                                     
truncate table ICitemScrapEntry   
truncate table ICMORpt                                                                         
truncate table ICMORptEntry     
truncate table QMReject                                                                        
truncate table QMRejectEntry   
truncate table ICMOConvertBill                                                                 
truncate table ICMOConvertBillEntry   
truncate table icinventory
truncate table icbal
truncate table icinvbal
truncate table ICInvInitial
truncate table ICShop_ItemConsumeEntry
truncate table CBStdStdPrice
truncate table ICQCBillEntry
truncate table cbMaterielInfo_History
truncate table ICMnbomChild
truncate table POInvBal
truncate table ICClassCheckRecords1001000
truncate table icstockbillentry2019011501
truncate table icstockbillentry20181120
truncate table ICQuotePriceMtrl
truncate table CRM_SVTrace
truncate table t_msgList
truncate table cbCalinfoDetail
truncate table ICBOMChild
truncate table ICPrintCountEntry
truncate table ICClassCheckStatus1001000
truncate table ICPrintCount
truncate table t_CashFlowBal
truncate table ICMrpResult
truncate table t_MakeVouchTemp
truncate table t_BaseProperty
truncate table ICClassMCRecord1000040
truncate table ICClassMCStatus1000040
truncate table t_ProfitAndLoss
truncate table t_ICItemCore
truncate table t_ICItemPlan
truncate table t_ICItemQuality
truncate table t_ICItemCustom
truncate table t_ICItemMaterial
truncate table t_ICItemBase
truncate table t_ICItemDesign
truncate table t_ICItemStandard
truncate table t_LowestBomCode
truncate table CRM_SVAssign
truncate table CRM_ServiceRequest
truncate table CRM_Satisfaction
truncate table CRM_SVProcess
truncate table cbCostObjDetail
truncate table ICVouchBillTranType
truncate table ICClassCheckRecords1001001
truncate table t_SupplyEntry
truncate table t_Supply
truncate table cbExpenseDistributeInfo_History
truncate table ICShop_ItemConsume
truncate table ICClassTableInfo_bak20080418194131
truncate table seorderentry20190624
truncate table seorderentry20190516
truncate table SEOutStockEntry20190624
truncate table ICClassCheckStatus1001001
truncate table CRM_Fittings
truncate table cbProductCalInfo
truncate table cbCalInfo
truncate table CRM_Contact
truncate table t_ItemDetailV
truncate table t_ItemDetail
truncate table ICMrpInfo
truncate table t_Balance
delete icstockcheckprocess 
delete icinvbackup 
DELETE FROM  t_Item WHERE FItemID >=135
DELETE FROM  t_Base_Emp WHERE FItemID >0
truncate table cb_CostObj_Product
truncate table cb_ICStockBill
truncate table cb_ICStockBillEntry
truncate table cbBalance
truncate table CBCalInfo_CurData
truncate table CBCalInfoDetail_CurData
truncate table cbCompleteQty
DELETE  cbCostObj WHERE FItemID NOT IN (55,56)
truncate table CBCostObjAdjustDetailbak
truncate table cbExpenseDistributeInfo
truncate table cbInQty
truncate table cbMaterielInfo
truncate table cbProductQty
truncate table cn_Bill
truncate table ICbal_sean2
truncate table ICBOM
truncate table ICClientVer
truncate table ICPlan_PMCDetail
truncate table ICPlanOrderRel
DELETE FROM  t_Account
truncate table t_Department
truncate table t_dev_AZ
truncate table t_dev_AZEntry2
truncate table t_dev_AZSQ
truncate table t_dev_AZSQEntry2
truncate table t_dev_AZZF
truncate table t_dev_AZZFEntry2
truncate table t_dev_freight
truncate table t_dev_freightEntry2
truncate table t_dev_TC
truncate table t_dev_TCEntry2
truncate table t_dev_TCPay
truncate table t_dev_TCPayEntry2
truncate table t_dev_ZX
truncate table t_dev_ZXEntry2
truncate table t_dev_ZXSQ
truncate table t_dev_ZXSQEntry2
truncate table t_dev_ZXZF
truncate table t_dev_ZXZFEntry2
truncate table t_LockStock
truncate table t_Organization
truncate table t_Stock
truncate table t_Supplier
DELETE FROM ICHookRelations
DELETE FROM cbWMaterielInfo
DELETE FROM cbWCalinfoDetail
DELETE FROM cbCostObjCheck
DELETE FROM ICQuotePrice
DELETE FROM cbWasterCostObjInfo
DELETE FROM cbCostVoucher
DELETE FROM CBCostExpenseInfo
DELETE FROM ICSubContract
DELETE FROM dbo.ICSubContractEntry 
DELETE FROM ICSerialFlow
--ÉèÖàÆôÓÃÆÚ¼ä£¬µ±Ç°ÆÚ¼ä,ÕâÀXÔ·ݿªÊ¼ÓþÍÉèÖÃΪ¼¸Ô·Ý
update t_SystemProfile set FValue=9 where FCategory='gl' and FKey='startperiod'
update t_SystemProfile set FValue=2020 where FCategory='gl' and FKey='startyear'
update t_SystemProfile set FValue=9 where FCategory='ic' and FKey='startperiod'
update t_SystemProfile set FValue=2020 where FCategory='ic' and FKey='startyear'
update t_SystemProfile set FValue=9 where FCategory='CB' and FKey='startperiod'
update t_SystemProfile set FValue=2020 where FCategory='CB' and FKey='startyear'
update t_SystemProfile set FValue=9 where FCategory='FA' and FKey='startperiod'
update t_SystemProfile set FValue=2020 where FCategory='FA' and FKey='startyear'
update t_SystemProfile set FValue=9 where FCategory='gl' and FKey='currentperiod'
update t_SystemProfile set FValue=2020 where FCategory='gl' and FKey='currentyear'
update t_SystemProfile set FValue=9 where FCategory='ic' and FKey='currentperiod'
update t_SystemProfile set FValue=2020 where FCategory='ic' and FKey='currentyear'
update t_SystemProfile set FValue=9 where FCategory='CB' and FKey='currentperiod'
update t_SystemProfile set FValue=2020 where FCategory='CB' and FKey='currentyear'
update t_SystemProfile set FValue=9 where FCategory='FA' and FKey='currentperiod'
update t_SystemProfile set FValue=2020 where FCategory='FA' and FKey='currentyear'
UPDATE  dbo.t_RP_SystemProfile set FValue=9    WHERE FKey ='FAPCurPeriod'          
UPDATE   dbo.t_RP_SystemProfile  set FValue=2020  WHERE FKey ='FAPCurYear'           
UPDATE   dbo.t_RP_SystemProfile set FValue=9   WHERE FKey ='FAPUsePeriod'          
UPDATE   dbo.t_RP_SystemProfile  set FValue=2020  WHERE FKey ='FAPUseYear'           
UPDATE   dbo.t_RP_SystemProfile set FValue=9   WHERE FKey ='FARCurPeriod'          
UPDATE   dbo.t_RP_SystemProfile set FValue=2020   WHERE FKey ='FARCurYear'           
UPDATE   dbo.t_RP_SystemProfile  set FValue=9  WHERE FKey ='FARUsePeriod'          
UPDATE   dbo.t_RP_SystemProfile set FValue=2020   WHERE FKey ='FARUseYear'           
--ÖØ½¨Ë÷Òý
DECLARE @DBCCString NVARCHAR(1000)
DECLARE @TableName VARCHAR(100) 
DECLARE Cur_Index CURSOR FOR  
SELECT Name AS TblName  FROM sysobjects   WHERE xType='U'  ORDER BY TblName FOR READ ONLY 
OPEN Cur_Index 
FETCH NEXT FROM Cur_Index INTO @TableName 
 
WHILE @@FETCH_STATUS=0 
BEGIN  
PRINT 'ÖØ½¨±í' + @TableName +'µÄË÷Òý........Start!'  
SET @DBCCString = 'DBCC DBREINDEX(@TblName,'''')WITH NO_INFOMSGS'  
EXEC SP_EXECUTESQL  @DBCCString,     N'@TblName VARCHAR(100)',     @TableName  
PRINT 'ÖØ½¨±í' + @TableName +'µÄË÷Òý........END!' 
FETCH NEXT FROM Cur_Index  INTO @TableName 
END 
CLOSE Cur_Index 
DEALLOCATE Cur_Index 
PRINT '²Ù×÷Íê³É£¡' 
--ÊÕËõÊý¾Ý¿â
DELETE FROM t_SuspendWorkPushMain
DELETE FROM t_SuspendWorkPushDetail
DELETE FROM ICClassMCTaskCenter