云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > 金蝶K3供应链反初始化SQL

金蝶K3供应链反初始化SQL

  • 62 次阅读
  • 3 次下载
  • 2025/6/18 8:28:19

金蝶K3软件物流反初始化的SQL语句 提醒:执行语句前一定要先备份账套! 以下为SQL语句具体内容:

If exists (select * from sysobjects where name='RestartSystem' and type='P')---检查存储过程是否存在

Drop procedure RestartSystem ----存在则删除之 Go

Create Procedure RestartSystem ---定义存储过程 AS

Declare @StartPeriodint, @startyearint,

@CurStartDatevarchar(20) ----处理余额和即时库存数据

Delete From ICBal Delete From ICInvBal Delete From ICInventory

Delete From ICInvInitial Where FPeriod>0 ----取帐套启用时间

select @startyear=convert(int,FValue) from t_SystemProfile where FCategory='ic' and FKey='startyear'

select @startperiod=convert(int,FValue) from t_SystemProfile where FCategory='ic' and FKey='startperiod'

select @CurStartDate=convert(varchar(4),@startyear)+ '-' + convert(varchar(2),@startperiod)+'-'+'01'

---select @CurStartDate=convert(varchar,convert(datetime, @CurStartDate),110)

---select @CurStartDate=substring( @CurStartDate,7,4)+'-'+substring( @CurStartDate,1,2)+'-'+substring( @CurStartDate,4,2) ----处理起用前的数据

delete from t_MakevouchTemp where FTranType=4000 and fgroupid=0 and fvchinterid=-1 and fprevchinterid=0

and fscbillinterid in (select finterid from icstockbill where fdate<@CurStartDate AND FTranType=1 And FCancellation=0)

delete from ICSaleVoucher WHERE finterid in(select finterid from icstockbill where FDate<@CurStartDate AND FTranType=21 AND FSaleStyle=102 AndFCancellation=0)

Update ICstockBill set FVchInterID=Null Where FDate<@CurStartDate AND FTranType=1 and FCancellation=0

第 1 页 共 2 页

----处理系统参数

Update t_SystemProfile Set FValue='0' Where FKey='ICClosed' and FCategory='IC'

Update t_SystemProfile Set FValue=convert(varchar(2),@startperiod) Where FKey='CurrentPeriod' and FCategory='IC'

Update t_SystemProFile Set FValue='0' Where FKey='InvDataPeriod' And FCategory='IC'

----转换初始余额数据时间

Update ICInvInitial Set FPeriod=convert(int,@StartPeriod) Where FPeriod=0

--Exec StockIniDataOn

--Update t_SystemProfile FCategory='IC' Return Go

------启动帐套

Exec RestartSystem Go

Set FValue='1' Where 第 2 页 共 2 页

FKey='ICClosed' and

搜索更多关于: 金蝶K3供应链反初始化SQL 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

金蝶K3软件物流反初始化的SQL语句 提醒:执行语句前一定要先备份账套! 以下为SQL语句具体内容: If exists (select * from sysobjects where name='RestartSystem' and type='P')---检查存储过程是否存在 Drop procedure RestartSystem ----存在则删除之 Go Create Procedure RestartSystem ---定义存储过程 AS Declare @StartPeriodint, @startyearint, @CurStartDatevarchar(20) ----处理余额和即时库存数据 Delete From ICBal Delete From ICInvBal Del

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com