<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Script to clean up SyncEntry_&lt;GUID&gt; and SubscriptionStatistics_&lt;GUID&gt; tables in the SQL database</title><link>http://blogs.msdn.com/b/ukdynsupport/archive/2009/05/07/script-to-clean-up-syncentry-guid-and-subscriptionstatistics-guid-tables-in-the-sql-database.aspx</link><description>SyncEntry_&amp;lt;GUID&amp;gt; and SubscriptionStatistics_&amp;lt;GUID&amp;gt; tables are created in the &amp;lt;CompanyName&amp;gt;_MSCRM SQL Database when using the CRM-outlook clients. Generally you will have 2 of each table for each Online Client, and 3 of each table for</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Script to clean up SyncEntry_&lt;GUID&gt; and SubscriptionStatistics_&lt;GUID&gt; tables in the SQL database</title><link>http://blogs.msdn.com/b/ukdynsupport/archive/2009/05/07/script-to-clean-up-syncentry-guid-and-subscriptionstatistics-guid-tables-in-the-sql-database.aspx#10205039</link><pubDate>Fri, 02 Sep 2011 11:59:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10205039</guid><dc:creator>David</dc:creator><description>&lt;p&gt;Dittoing a prior question I&amp;#39;d like considered prior to my doing an upgrade to 4.0.&lt;/p&gt;
&lt;p&gt;Does this work for CRM 3.0 as well?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10205039" width="1" height="1"&gt;</description></item><item><title>re: Script to clean up SyncEntry_&lt;GUID&gt; and SubscriptionStatistics_&lt;GUID&gt; tables in the SQL database</title><link>http://blogs.msdn.com/b/ukdynsupport/archive/2009/05/07/script-to-clean-up-syncentry-guid-and-subscriptionstatistics-guid-tables-in-the-sql-database.aspx#10108171</link><pubDate>Wed, 22 Dec 2010 15:35:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10108171</guid><dc:creator>Chad Rexin - Microsoft</dc:creator><description>&lt;p&gt;Note that if you wanted to be more selective and only delete syncentry and subscription tables for ones that haven&amp;#39;t been synced in the last 90 or more days, you could change the following lines in the script at this site.&lt;/p&gt;
&lt;p&gt;DECLARE CRMSync_cursor CURSOR FOR&lt;/p&gt;
&lt;p&gt;select substring(SyncEntryTableName,11,42) as SyncEntryGUID from subscription where systemuserid in&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;(select systemuserid from systemuserbase where domainname =@DN)&lt;/p&gt;
&lt;p&gt;To&lt;/p&gt;
&lt;p&gt;DECLARE CRMSync_cursor CURSOR FOR&lt;/p&gt;
&lt;p&gt;select substring(SyncEntryTableName,11,42) as SyncEntryGUID from subscription where systemuserid in&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;(select systemuserid from systemuserbase where domainname =@DN) AND (LastSyncStartedOn &amp;lt; GetDate()-90 or LastSyncStartedOn is NULL)&lt;/p&gt;
&lt;p&gt;As with any SQL scripts like this, I&amp;#39;d strongly recommend making a backup first before running them and preferably running them on a Dev or Test environment first before implementing in production.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10108171" width="1" height="1"&gt;</description></item><item><title>re: Script to clean up SyncEntry_&lt;GUID&gt; and SubscriptionStatistics_&lt;GUID&gt; tables in the SQL database</title><link>http://blogs.msdn.com/b/ukdynsupport/archive/2009/05/07/script-to-clean-up-syncentry-guid-and-subscriptionstatistics-guid-tables-in-the-sql-database.aspx#10054590</link><pubDate>Thu, 26 Aug 2010 12:54:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10054590</guid><dc:creator>Steven</dc:creator><description>&lt;p&gt;Does this work for CRM 3.0 as well?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10054590" width="1" height="1"&gt;</description></item><item><title>re: Script to clean up SyncEntry_&lt;GUID&gt; and SubscriptionStatistics_&lt;GUID&gt; tables in the SQL database</title><link>http://blogs.msdn.com/b/ukdynsupport/archive/2009/05/07/script-to-clean-up-syncentry-guid-and-subscriptionstatistics-guid-tables-in-the-sql-database.aspx#10053591</link><pubDate>Tue, 24 Aug 2010 14:12:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10053591</guid><dc:creator>Greg Owens</dc:creator><description>&lt;p&gt;Hi Tony - for the record, this CAN break user records for active users - I followed the additional steps on in the comments (ukdynsupport 4 Jun 2009 12:28 PM) on my development system and found that simply accessing CRM Options in Outlook caused an error. This was easily overcome by re-mapping my users (go to user record, change domain logon name to another record, save, then change it back to original logon name and re-save). This would be a bit disasterous on a live system though!&lt;/p&gt;
&lt;p&gt;To be clear: the additional steps should only be carried out on records that are returned by the query: select * from Subscription where SystemUserId not in (select SystemuserId from SystemUserBase)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10053591" width="1" height="1"&gt;</description></item><item><title>re: Script to clean up SyncEntry_&lt;GUID&gt; and SubscriptionStatistics_&lt;GUID&gt; tables in the SQL database</title><link>http://blogs.msdn.com/b/ukdynsupport/archive/2009/05/07/script-to-clean-up-syncentry-guid-and-subscriptionstatistics-guid-tables-in-the-sql-database.aspx#10029694</link><pubDate>Thu, 24 Jun 2010 16:18:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10029694</guid><dc:creator>Tony</dc:creator><description>&lt;p&gt;Thanks for this, is there any risk in deleting the tables for active users? Will running this mess up user sync&amp;#39;s going forward?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10029694" width="1" height="1"&gt;</description></item><item><title>re: Script to clean up SyncEntry_&lt;GUID&gt; and SubscriptionStatistics_&lt;GUID&gt; tables in the SQL database</title><link>http://blogs.msdn.com/b/ukdynsupport/archive/2009/05/07/script-to-clean-up-syncentry-guid-and-subscriptionstatistics-guid-tables-in-the-sql-database.aspx#9699910</link><pubDate>Thu, 04 Jun 2009 19:28:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9699910</guid><dc:creator>ukdynsupport</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I've tried importing an organization and I wasn't able to reproduce this issue.&lt;/p&gt;
&lt;p&gt;I think that the only reason the script wouldn't work is if you have a SystemUserId in the Subscription table that doesn't exist in the SystemUserBase table. &amp;nbsp;You can identify these records by running the following script:&lt;/p&gt;
&lt;p&gt;select * from Subscription where SystemUserId not in (select SystemuserId from SystemUserBase)&lt;/p&gt;
&lt;p&gt;If you do have some records returned by this statement, you can run through the following steps to clean the remaining tables (it's a slightly more manual process):&lt;/p&gt;
&lt;p&gt;1.) &amp;nbsp;Using SQL Management Studio, create &amp;quot;Drop Table&amp;quot; scripts for all SyncEntry_&amp;lt;guid&amp;gt; tables:&lt;/p&gt;
&lt;p&gt;	A.) &amp;nbsp;Right click on your database and choose Tasks =&amp;gt; Generate Scripts...&lt;/p&gt;
&lt;p&gt;	B.) &amp;nbsp;Choose Next, and select your &amp;lt;CompanyName&amp;gt;_MSCRM database and choose next&lt;/p&gt;
&lt;p&gt;	C.) &amp;nbsp;In the next window, change all options to false except &amp;quot;Script Drop&amp;quot; (this should be set to true). &amp;nbsp;Then choose next.&lt;/p&gt;
&lt;p&gt;	D.) &amp;nbsp;Mark &amp;quot;Tables&amp;quot; as the object type, then hit next.&lt;/p&gt;
&lt;p&gt;	E.) &amp;nbsp;Mark all SyncEntry_&amp;lt;guid&amp;gt; tables. &amp;nbsp;(It'll probably be easier to choose &amp;quot;Select All&amp;quot;, then unmark all tables except the SyncEntry tables). &amp;nbsp;Hit Next.&lt;/p&gt;
&lt;p&gt;	F.) &amp;nbsp;Choose to script to a new query window, then hit finish.&lt;/p&gt;
&lt;p&gt;	G.) &amp;nbsp;Once this is done, you should have a script that will drop all current existing SyncEntry tables.&lt;/p&gt;
&lt;p&gt;	H.) &amp;nbsp;Execute this script against your &amp;lt;CompanyName&amp;gt;_MSCRM database&lt;/p&gt;
&lt;p&gt;2.) &amp;nbsp;Repeat Step 1, except when you get to part E, mark all SubscriptionStatistics_&amp;lt;guid&amp;gt; tables.&lt;/p&gt;
&lt;p&gt;3.) &amp;nbsp;Run the following SQL Script against the &amp;lt;CompanyName&amp;gt;_MSCRM database:&lt;/p&gt;
&lt;p&gt;delete SubscriptionSyncInfo&lt;/p&gt;
&lt;p&gt;GO&lt;/p&gt;
&lt;p&gt;delete SubscriptionClients&lt;/p&gt;
&lt;p&gt;GO&lt;/p&gt;
&lt;p&gt;delete Subscription&lt;/p&gt;
&lt;p&gt;GO&lt;/p&gt;
&lt;p&gt;Thank you,&lt;/p&gt;
&lt;p&gt;Justin&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9699910" width="1" height="1"&gt;</description></item><item><title>re: Script to clean up SyncEntry_&lt;GUID&gt; and SubscriptionStatistics_&lt;GUID&gt; tables in the SQL database</title><link>http://blogs.msdn.com/b/ukdynsupport/archive/2009/05/07/script-to-clean-up-syncentry-guid-and-subscriptionstatistics-guid-tables-in-the-sql-database.aspx#9684976</link><pubDate>Tue, 02 Jun 2009 13:32:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9684976</guid><dc:creator>check</dc:creator><description>&lt;p&gt;Hello Justin,&lt;/p&gt;
&lt;p&gt;This is a very usefull query you've developed here and works very well indeed! &amp;nbsp;However, I've noticed that it doesn't remove sync tables in a imported organisation, where the tables were created prior to the import. &amp;nbsp;I assume that this is because there's no domain history in the CRM database?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9684976" width="1" height="1"&gt;</description></item><item><title>Script to clean up SyncEntry_ and SubscriptionStatistics_ tables in the SQL database | Microsoft Share Point</title><link>http://blogs.msdn.com/b/ukdynsupport/archive/2009/05/07/script-to-clean-up-syncentry-guid-and-subscriptionstatistics-guid-tables-in-the-sql-database.aspx#9593297</link><pubDate>Thu, 07 May 2009 13:22:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9593297</guid><dc:creator>Script to clean up SyncEntry_ and SubscriptionStatistics_ tables in the SQL database | Microsoft Share Point</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://microsoft-sharepoint.simplynetdev.com/script-to-clean-up-syncentry_-and-subscriptionstatistics_-tables-in-the-sql-database/"&gt;http://microsoft-sharepoint.simplynetdev.com/script-to-clean-up-syncentry_-and-subscriptionstatistics_-tables-in-the-sql-database/&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9593297" width="1" height="1"&gt;</description></item></channel></rss>