• 用友删除年度数据,删除帐套


    删除年度数据:
    select   tname ,name
     From (SELECT object_name([id]) as tname,name From [syscolumns]
     where [name] in('cacc_id' ,'accid','caccid') and object_name([id])<>'UA_Account'
    and objectproperty([id],'isusertable')=1)
     as t Left Join (SELECT  distinct object_name([rkeyid]) as rname
     FROM [sysreferences]) as r on tname=rname Left Join
     (SELECT   distinct object_name([fkeyid]) fname
     FROM [sysreferences]) as f
     on fname=tname order by tname ,[name]

    select   tname ,name
     From (SELECT object_name([id]) as tname,name From [syscolumns]
     where [name] like '%year'  and object_name([id])<>'UA_Account'
    and objectproperty([id],'isusertable')=1)
    as t Left Join (SELECT  distinct object_name([rkeyid]) as rname
     FROM [sysreferences]) as r on tname=rname Left Join
     (SELECT   distinct object_name([fkeyid]) fname
     FROM [sysreferences]) as f
     on fname=tname order by tname ,[name]

    delete from UA_Account_sub where cAcc_Id=901
    and iYear=2010

    delete from UA_BackupLog where cAcc_Id=901
    and iYear=2010

    delete from UA_BackupPlans where cAcc_Id=901
    and iYear=2010

    delete from UA_HoldAuth where cAcc_Id=901
    and iYear=2010

    delete from UA_Log where cAcc_Id=901
    and iyear=2010

    delete from UA_Period where cAcc_Id=901
    and iYear=2010

    delete from UA_Task where cAcc_Id=901
    and iYear=2010

    Drop database ufdata_901_2010


    删除帐套
    select   tname ,name From (SELECT object_name([id]) as tname,name From [syscolumns] where [name] in('cacc_id' ,'accid','caccid') and object_name([id]) not in('UA_Account') )  as t Left Join (SELECT  distinct object_name([rkeyid]) as rname FROM [sysreferences]) as r on tname=rname Left Join  (SELECT   distinct object_name([fkeyid]) fname FROM [sysreferences]) as f on fname=tname order by fname desc, rnameselect   tname ,name From (SELECT object_name([id]) as tname,name From [syscolumns] where [name] in('cacc_id' ,'accid','caccid') and object_name([id]) not in('UA_Account') )  as t Left Join (SELECT  distinct object_name([rkeyid]) as rname FROM [sysreferences]) as r on tname=rname Left Join  (SELECT   distinct object_name([fkeyid]) fname FROM [sysreferences]) as f on fname=tname order by fname desc, rname

    delete from UA_Task where cAcc_Id=999

    delete from UA_Period where cAcc_Id=999

    delete from UA_Log where cAcc_Id=999

    delete from UA_HoldAuth where cAcc_Id=999

    delete from UA_Account_sub where cAcc_Id=999

    delete from UA_BackupLog where cAcc_Id=999

    delete from UA_BackupPlans where cAcc_Id=999

    DELETE FROM UA_account WHERE cacc_id = '999'

    Drop database ufdata_999_2008

  • 相关阅读:
    SpringMVC Hello World
    SQL Server存储过程同时返回分页结果集和总数
    C#微信公众号开发--网页授权(oauth2.0)获取用户基本信息二
    C#微信公众号开发--网页授权(oauth2.0)获取用户基本信息一
    C#微信公众号开发--微信事件交互
    C# 微信公众号开发--准备工作
    windows环境redis主从安装部署
    javascript设计模式:策略模式
    Unity3d 屏幕截图。并保存。iOS
    注册消息来判断屏幕是否旋转
  • 原文地址:https://www.cnblogs.com/martian6125/p/9631199.html
Copyright © 2020-2023  润新知