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

推荐订阅源

S
Secure Thoughts
罗磊的独立博客
T
The Blog of Author Tim Ferriss
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
Last Week in AI
Last Week in AI
美团技术团队
Google Online Security Blog
Google Online Security Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
D
Docker
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
酷 壳 – CoolShell
酷 壳 – CoolShell
小众软件
小众软件
月光博客
月光博客
L
LINUX DO - 最新话题
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
W
WeLiveSecurity
H
Heimdal Security Blog
Vercel News
Vercel News
SecWiki News
SecWiki News
Forbes - Security
Forbes - Security
Blog — PlanetScale
Blog — PlanetScale
Google DeepMind News
Google DeepMind News
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
TaoSecurity Blog
TaoSecurity Blog
T
Troy Hunt's Blog
A
About on SuperTechFans
C
Check Point Blog
S
Security Affairs
Hacker News - Newest:
Hacker News - Newest: "LLM"
AI
AI
WordPress大学
WordPress大学
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Help Net Security
Help Net Security
博客园_首页
The Last Watchdog
The Last Watchdog
S
SegmentFault 最新的问题
Hugging Face - Blog
Hugging Face - Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
Engineering at Meta
Engineering at Meta
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
I
Intezer
K
Kaspersky official blog
M
MIT News - Artificial intelligence
J
Java Code Geeks
G
GRAHAM CLULEY
P
Palo Alto Networks Blog

博客园 - 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