惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tor Project blog
博客园 - 聂微东
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
IT之家
IT之家
I
InfoQ
The Cloudflare Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
人人都是产品经理
人人都是产品经理
美团技术团队
B
Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Last Week in AI
Last Week in AI
TaoSecurity Blog
TaoSecurity Blog
Hacker News: Ask HN
Hacker News: Ask HN
T
Threatpost
H
Heimdal Security Blog
爱范儿
爱范儿
博客园_首页
SecWiki News
SecWiki News
腾讯CDC
大猫的无限游戏
大猫的无限游戏
GbyAI
GbyAI
The Register - Security
The Register - Security
N
News | PayPal Newsroom
Recent Commits to openclaw:main
Recent Commits to openclaw:main
云风的 BLOG
云风的 BLOG
酷 壳 – CoolShell
酷 壳 – CoolShell
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Security Latest
Security Latest
A
Arctic Wolf
P
Privacy & Cybersecurity Law Blog
T
The Blog of Author Tim Ferriss
M
MIT News - Artificial intelligence
Microsoft Security Blog
Microsoft Security Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
量子位
Schneier on Security
Schneier on Security
Microsoft Azure Blog
Microsoft Azure Blog
Attack and Defense Labs
Attack and Defense Labs
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Webroot Blog
Webroot Blog
C
Check Point Blog
Y
Y Combinator Blog
T
The Exploit Database - CXSecurity.com
aimingoo的专栏
aimingoo的专栏
I
Intezer
博客园 - 叶小钗
Cisco Talos Blog
Cisco Talos Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
小众软件
小众软件

博客园 - Seer Lin

自己开发的ERP系统,有需要的联系 MSCRM2016 取消邮箱强制SSL 不听话的下属辞职记 Windows 7下,巧让家用UPS也支持电脑自动关机 海蜘蛛去广告 [转]SQL2008链接服务器数据同步 asp.net 在IE8 导出excel时的问题 [转]mssql链接服务器 win2008 R2 64位系统下配置DCOM权限 [转]excel 操作类 在excel中,将 长*宽*高 这样的格式列,拆分成3列 将没有产品图片的产品设置为不在前台显示SQL实现 [转]在Reporting Services报表中引用FTP站点上的图片 mscrm js webservic 常用功能 mscrm4.0 判断当前用户角色_示例 mscrm 4.0 获取当前用户角色 mscrm4.0 获取当前登录的用户名 mscrm4.0 用js调用Webservice vs2010 js 代码折叠插件 MSCRM offline plugin开发注意事项
MSCRM 删除客户数据
Seer Lin · 2011-01-21 · via 博客园 - Seer Lin

代码


declare @i int=1
declare @tmpTable table(Id uniqueidentifier primary key)delete dbo.OpportunityExtensionBase
delete dbo.OpportunityProductExtensionBase
delete dbo.OpportunityProductBase
delete dbo.OpportunityCloseBase
delete dbo.OpportunityCompetitors
delete dbo.QuoteDetailExtensionBase
delete dbo.QuoteDetailBase
delete dbo.QuoteExtensionBase
delete dbo.QuoteBase
delete dbo.SalesOrderDetailExtensionBase
delete dbo.SalesOrderDetailBase
delete dbo.SalesOrderExtensionBase
delete dbo.SalesOrderBase
delete dbo.InvoiceDetailExtensionBase
delete dbo.InvoiceDetailBase
delete dbo.InvoiceExtensionBase
delete dbo.InvoiceBase
delete dbo.OpportunityBasedelete dbo.PhoneCallExtensionBase
delete dbo.PhoneCallBasedelete dbo.TaskExtensionBase
delete dbo.TaskBasedelete dbo.LetterExtensionBase
delete dbo.LetterBasedelete dbo.LeadProduct
delete dbo.LeadExtensionBasedelete dbo.LeadCompetitors
delete dbo.LeadAddressBase
delete dbo.LeadBasedelete dbo.FaxExtensionBase
delete dbo.FaxBasedelete dbo.EmailHashBase
delete dbo.EmailExtensionBase
delete dbo.EmailBasetruncate table dbo.CustomerAddressExtensionBase
--declare @i int=1,@id uniqueidentifier
--
declare @tmpTable table(Id uniqueidentifier)
set @i=1
while @i>0
begin    
    
insert into @tmpTable
    
select top 20000 CustomerAddressId from dbo.CustomerAddressBase
    
set @i=@@ROWCOUNT
    
delete from dbo.CustomerAddressBase where CustomerAddressId in(
        
select [Id] from @tmpTable
    )
    
    
delete @tmpTable
enddelete dbo.AppointmentExtensionBase
delete dbo.AppointmentBase--declare @i int=1,@id uniqueidentifier
--
declare @tmpTable table(Id uniqueidentifier)
set @i=1
while @i>0
begin    
    
insert into @tmpTable
    
select top 20000 ActivityId from dbo.AppointmentBase
    
set @i=@@ROWCOUNT
    
delete from dbo.AppointmentBase where ActivityId in(
        
select [Id] from @tmpTable
    )    
    
delete @tmpTable
enddelete dbo.BulkOperationLogBase
delete dbo.BulkOperationBasedelete dbo.ServiceAppointmentBasedelete dbo.CampaignActivityItemBase
delete dbo.CampaignActivityBase
delete dbo.CampaignActivityBasedelete dbo.ActivityPointerBase
delete dbo.ActivityPartyBasedelete dbo.ContactExtensionBase
--declare @i int=1,@id uniqueidentifier
--
declare @tmpTable table(Id uniqueidentifier)
set @i=1
while @i>0
begin    
    
insert into @tmpTable
    
select top 20000 ContactId from dbo.ContactBase
    
set @i=@@ROWCOUNT
    
delete from dbo.ContactBase where ContactId in(
        
select [Id] from @tmpTable
    )    
    
delete @tmpTable
enddelete dbo.AccountLeadstruncate table dbo.AccountExtensionBase
--declare @i int=1,@id uniqueidentifier
--
declare @tmpTable table(Id uniqueidentifier)
set @i=1
while @i>0
begin    
    
insert into @tmpTable
    
select top 20000 AccountId from dbo.AccountBase
    
set @i=@@ROWCOUNT
    
delete from dbo.AccountBase where AccountId in(
        
select [Id] from @tmpTable
    )    
    
delete @tmpTable
end