<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Nestor Sulikowski</title>
	<atom:link href="http://nestorsulikowski.com/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://nestorsulikowski.com</link>
	<description>Blog</description>
	<lastBuildDate>Mon, 23 Aug 2010 00:13:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Silverlight Calculator</title>
		<link>http://nestorsulikowski.com/index.php/2010/08/silverlight-calculator/</link>
		<comments>http://nestorsulikowski.com/index.php/2010/08/silverlight-calculator/#comments</comments>
		<pubDate>Sun, 22 Aug 2010 22:27:45 +0000</pubDate>
		<dc:creator>nestor</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://nestorsulikowski.com/index.php/2010/08/silverlight-calculator/</guid>
		<description><![CDATA[Toolbox Module 2 (Calculator)]]></description>
			<content:encoded><![CDATA[<p>Toolbox Module 2 (Calculator)</p>
<p> <iframe height="700" src="http://nestorsulikowski.com/Calculator.html" frameborder="0" width="800" scrolling="no"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://nestorsulikowski.com/index.php/2010/08/silverlight-calculator/feed/</wfw:commentRss>
		<slash:comments>525</slash:comments>
		</item>
		<item>
		<title>Sync Framework Diagrams: Simple provider</title>
		<link>http://nestorsulikowski.com/index.php/2010/01/sync-framework-diagrams-simple-provider/</link>
		<comments>http://nestorsulikowski.com/index.php/2010/01/sync-framework-diagrams-simple-provider/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 19:06:10 +0000</pubDate>
		<dc:creator>nestor</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://nestorsulikowski.com/index.php/2010/01/sync-framework-diagrams-simple-provider/</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><iframe height="600" src="http://deepzoompix.com/DZApp/IFrame.aspx?alias=nsulikow&amp;album=7" frameborder="0" width="800" scrolling="no"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://nestorsulikowski.com/index.php/2010/01/sync-framework-diagrams-simple-provider/feed/</wfw:commentRss>
		<slash:comments>1000</slash:comments>
		</item>
		<item>
		<title>Sync Framework + SQL 2008 Change Tracking</title>
		<link>http://nestorsulikowski.com/index.php/2010/01/sqlsyncadapterbuilder-queries-using-sqlserverchangetracking/</link>
		<comments>http://nestorsulikowski.com/index.php/2010/01/sqlsyncadapterbuilder-queries-using-sqlserverchangetracking/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 20:15:00 +0000</pubDate>
		<dc:creator>nestor</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://nestorsulikowski.com/index.php/2010/01/sqlsyncadapterbuilder-queries-using-sqlserverchangetracking/</guid>
		<description><![CDATA[For table: CREATE TABLE [dbo].[quote] ( [Quote_ID] [bigint] IDENTITY(1,1) primary key NOT NULL, [QuoteNumber] [bigint] NOT NULL, [QuoteVersion] [bigint] NOT NULL, [SalesRepFName] [varchar](50) NOT NULL, [SalesRepLName] [varchar](50) NOT NULL, ) Scripts -Database setup ALTER DATABASE [QuoteEngineDB] SET CHANGE_TRACKING=ON (AUTO_CLEANUP = ON, CHANGE_RETENTION=1 MINUTES) ALTER DATABASE [QuoteEngineDB] SET CHANGE_TRACKING = OFF --Table setup ALTER TABLE [dbo].[quote] [...]]]></description>
			<content:encoded><![CDATA[<p>For table:</p>
</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:8b7afac9-3fc1-4b28-afd2-4fb733d17325" class="wlWriterEditableSmartContent">
<pre name="code" class="sql">CREATE TABLE [dbo].[quote] (
	[Quote_ID] [bigint] IDENTITY(1,1) primary key NOT NULL,
	[QuoteNumber] [bigint] NOT NULL,
	[QuoteVersion] [bigint] NOT NULL,
	[SalesRepFName] [varchar](50) NOT NULL,
	[SalesRepLName] [varchar](50) NOT NULL,
)
</pre>
</div>
<h2>Scripts</h2>
</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:46cc9d9f-5592-476f-9922-8b2f31703212" class="wlWriterEditableSmartContent">
<pre name="code" class="sql">-Database setup
ALTER DATABASE [QuoteEngineDB] SET CHANGE_TRACKING=ON (AUTO_CLEANUP = ON, CHANGE_RETENTION=1 MINUTES)
ALTER DATABASE [QuoteEngineDB] SET CHANGE_TRACKING = OFF
--Table setup
ALTER TABLE [dbo].[quote] ENABLE CHANGE_TRACKING with (TRACK_COLUMNS_UPDATED = ON)
ALTER TABLE [dbo].[quote] DISABLE CHANGE_TRACKING
</pre>
</div>
</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:1df587d1-3511-4786-96e7-d337e83cb0e1" class="wlWriterEditableSmartContent">
<pre name="code" class="sql">select *,
	(select name from sys.databases where database_id=p.database_id) as database_name
from sys.change_tracking_databases p
</pre>
</div>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://nestorsulikowski.com/wp-content/uploads/2010/01/image.png" width="684" height="60" /> </p>
</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:31612ac4-1ca6-48b1-b8ff-ee5aea7a6875" class="wlWriterEditableSmartContent">
<pre name="code" class="sql">use QuoteEngineDB
select
	object_id,
	(select name from sys.tables where object_id=p.object_id) as table_name,
	is_track_columns_updated_on,
	min_valid_version,
	begin_version,
	cleanup_version
from sys.change_tracking_tables p
</pre>
</div>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://nestorsulikowski.com/wp-content/uploads/2010/01/image1.png" width="705" height="44" /> </p>
</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:80c1c9fa-7836-4ead-99aa-a0dd51dc9dcd" class="wlWriterEditableSmartContent">
<pre name="code" class="sql">declare @min as bigint = CHANGE_TRACKING_MIN_VALID_VERSION ( object_id(N'dbo.quote') )
declare @curr as bigint = CHANGE_TRACKING_CURRENT_VERSION()
select @min [min], @curr [curr]
select * from CHANGETABLE(CHANGES dbo.quote, @min) CT</pre>
</div>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://nestorsulikowski.com/wp-content/uploads/2010/01/image2.png" width="810" height="115" /></p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:a471628f-3456-44c9-abf9-225b9a23d3dd" class="wlWriterEditableSmartContent">
<pre name="code" class="sql">SELECT * FROM dbo.quote p
cross apply (
	select * from CHANGETABLE(VERSION dbo.quote, ([Quote_ID]), (p.Quote_ID)) CT
) applyT</pre>
</div>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://nestorsulikowski.com/wp-content/uploads/2010/01/image3.png" width="814" height="78" />&#160; </p>
<h2>SqlSyncAdapterBuilder: Queries using SqlServerChangeTracking</h2>
<p>&#160;</p>
<table border="1" cellspacing="0" cellpadding="2" width="509">
<tbody>
<tr>
<td valign="top" width="182">&#160;</td>
<td valign="top" width="96" align="center"><strong>DownloadOnly</strong></td>
<td valign="top" width="77" align="center"><strong>UploadOnly</strong></td>
<td valign="top" width="87" align="center"><strong>Bidirectional</strong> </p>
<p>(default)</td>
<td valign="top" width="65" align="center"><strong>Snapshot</strong></td>
</tr>
<tr>
<td valign="top" width="182"><strong>Insert</strong></td>
<td valign="top" width="96" align="center">&#160;</td>
<td valign="top" width="77" align="center">(<a href="#code1">1</a>)</td>
<td valign="top" width="87" align="center">(<a href="#code1">1</a>)</td>
<td valign="top" width="65" align="center">&#160;</td>
</tr>
<tr>
<td valign="top" width="182"><strong>Delete</strong></td>
<td valign="top" width="96" align="center">&#160;</td>
<td valign="top" width="77" align="center">(<a href="#code2">2</a>)</td>
<td valign="top" width="87" align="center">(<a href="#code2">2</a>)</td>
<td valign="top" width="65" align="center">&#160;</td>
</tr>
<tr>
<td valign="top" width="182"><strong>Update</strong></td>
<td valign="top" width="96" align="center">&#160;</td>
<td valign="top" width="77" align="center">(<a href="#code3">3</a>)</td>
<td valign="top" width="87" align="center">(<a href="#code3">3</a>)</td>
<td valign="top" width="65" align="center">&#160;</td>
</tr>
<tr>
<td valign="top" width="182"><strong>SelectIncrementalInserts</strong></td>
<td valign="top" width="96" align="center">(<a href="#code9">9</a>)</td>
<td valign="top" width="77" align="center">&#160;</td>
<td valign="top" width="87" align="center">(<a href="#code4">4</a>)</td>
<td valign="top" width="65" align="center">(<a href="#code10">10</a>)</td>
</tr>
<tr>
<td valign="top" width="182"><strong>SelectIncrementalDeletes</strong></td>
<td valign="top" width="96" align="center">(<a href="#code5">5</a>)</td>
<td valign="top" width="77" align="center">&#160;</td>
<td valign="top" width="87" align="center">(<a href="#code5">5</a>)</td>
<td valign="top" width="65" align="center">&#160;</td>
</tr>
<tr>
<td valign="top" width="182"><strong>SelectIncrementalUpdates</strong></td>
<td valign="top" width="96" align="center">(<a href="#code6">6</a>)</td>
<td valign="top" width="77" align="center">&#160;</td>
<td valign="top" width="87" align="center">(<a href="#code6">6</a>)</td>
<td valign="top" width="65" align="center">&#160;</td>
</tr>
<tr>
<td valign="top" width="182"><strong>SelectConflictDeletedRows</strong></td>
<td valign="top" width="96" align="center">&#160;</td>
<td valign="top" width="77" align="center">(<a href="#code7">7</a>)</td>
<td valign="top" width="87" align="center">(<a href="#code7">7</a>)</td>
<td valign="top" width="65" align="center">&#160;</td>
</tr>
<tr>
<td valign="top" width="182"><strong>SelectConflictUpdatedRows</strong></td>
<td valign="top" width="96" align="center">&#160;</td>
<td valign="top" width="77" align="center">(<a href="#code8">8</a>)</td>
<td valign="top" width="87" align="center">(<a href="#code8">8</a>)</td>
<td valign="top" width="65" align="center">&#160;</td>
</tr>
</tbody>
</table>
<h3 id="code1">(1)</h3>
</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:58406fdb-40cd-46d4-bcac-653e3c49ce59" class="wlWriterEditableSmartContent">
<pre name="code" class="sql">CREATE PROCEDURE ssInsertCommand(
	@sync_client_id_binary VARBINARY,

	@Quote_ID bigint,
	@QuoteNumber bigint,
	@QuoteVersion bigint,
	@SalesRepFName varchar(50),
	@SalesRepLName varchar(50),

	@sync_row_count int out,
	@sync_last_received_anchor bigint
)
AS
BEGIN
	SET IDENTITY_INSERT dbo.quote ON ;

	WITH CHANGE_TRACKING_CONTEXT (@sync_client_id_binary)
		INSERT INTO dbo.quote
			([Quote_ID], [QuoteNumber], [QuoteVersion], [SalesRepFName], [SalesRepLName])
		VALUES
			(@Quote_ID, @QuoteNumber, @QuoteVersion, @SalesRepFName, @SalesRepLName)
	SET @sync_row_count = @@rowcount;
	IF CHANGE_TRACKING_MIN_VALID_VERSION(object_id(N'dbo.quote')) &gt; @sync_last_received_anchor
		RAISERROR (N'SQL Server Change Tracking has cleaned up tracking information for table ''%s''.
		To recover from this error, the client must reinitialize its local database and try again',16,3,N'dbo.quote')  

	SET IDENTITY_INSERT dbo.quote OFF
END
GO
</pre>
</div>
<h3 id="code2">(2)</h3>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:3b902083-ef70-41f7-b129-b53ad9b6a119" class="wlWriterEditableSmartContent">
<pre name="code" class="sql">CREATE PROCEDURE ssDeleteCommand(
	@sync_client_id_binary VARBINARY,

	@Quote_ID bigint,

	@sync_force_write bit,
	@sync_last_received_anchor bigint,
	@sync_row_count int out
)
AS
BEGIN
	WITH CHANGE_TRACKING_CONTEXT (@sync_client_id_binary)
		DELETE dbo.quote
		FROM dbo.quote JOIN CHANGETABLE(VERSION dbo.quote, ([Quote_ID]), (@Quote_ID)) CT
			ON CT.[Quote_ID] = dbo.quote.[Quote_ID]
		WHERE (
			@sync_force_write = 1 OR
			CT.SYS_CHANGE_VERSION IS NULL OR
			CT.SYS_CHANGE_VERSION &lt;= @sync_last_received_anchor OR
			(CT.SYS_CHANGE_CONTEXT IS NOT NULL AND CT.SYS_CHANGE_CONTEXT = @sync_client_id_binary)
		)
	SET @sync_row_count = @@rowcount;
	IF CHANGE_TRACKING_MIN_VALID_VERSION(object_id(N'dbo.quote')) &gt; @sync_last_received_anchor
		RAISERROR (N'SQL Server Change Tracking has cleaned up tracking information for table ''%s''.
		To recover from this error, the client must reinitialize its local database and try again',16,3,N'dbo.quote')
END
GO
</pre>
</div>
<h3 id="code3">(3)</h3>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:0b1b772b-50d4-458b-92c2-0e82f29afbad" class="wlWriterEditableSmartContent">
<pre name="code" class="sql">CREATE PROCEDURE ssUpdateCommand(
	@QuoteNumber bigint,
	@QuoteVersion bigint,
	@SalesRepFName varchar(50),
	@SalesRepLName varchar(50),
	@Quote_ID bigint,

	@sync_force_write bit,
	@sync_last_received_anchor bigint,
	@sync_client_id_binary VARBINARY,
	@sync_row_count int out
)
AS
BEGIN
	WITH CHANGE_TRACKING_CONTEXT (@sync_client_id_binary)
		UPDATE dbo.quote
		SET [QuoteNumber] = @QuoteNumber, [QuoteVersion] = @QuoteVersion, [SalesRepFName] = @SalesRepFName,
			[SalesRepLName] = @SalesRepLName
		FROM dbo.quote JOIN CHANGETABLE(VERSION dbo.quote, ([Quote_ID]), (@Quote_ID)) CT
			ON CT.[Quote_ID] = dbo.quote.[Quote_ID]
		WHERE (
			@sync_force_write = 1 OR
			CT.SYS_CHANGE_VERSION IS NULL OR
			CT.SYS_CHANGE_VERSION &lt;= @sync_last_received_anchor OR
			(CT.SYS_CHANGE_CONTEXT IS NOT NULL AND CT.SYS_CHANGE_CONTEXT = @sync_client_id_binary)
		)
	SET @sync_row_count = @@rowcount;
	IF CHANGE_TRACKING_MIN_VALID_VERSION(object_id(N'dbo.quote')) &gt; @sync_last_received_anchor
		RAISERROR (N'SQL Server Change Tracking has cleaned up tracking information for table ''%s''.
		To recover from this error, the client must reinitialize its local database and try again',16,3,N'dbo.quote')
END
GO
</pre>
</div>
<h3 id="code4">(4)</h3>
</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:120bedf4-73ae-490d-8632-37675e3f1321" class="wlWriterEditableSmartContent">
<pre name="code" class="sql">CREATE PROCEDURE ssSelectIncrementalInserts (
	@sync_initialized bit,
	@sync_last_received_anchor bigint,
	@sync_new_received_anchor bigint,
	@sync_client_id_binary VARBINARY
)
AS
BEGIN
	IF @sync_initialized = 0
		SELECT dbo.quote.[Quote_ID], [QuoteNumber], [QuoteVersion], [SalesRepFName], [SalesRepLName]
		FROM dbo.quote LEFT OUTER JOIN CHANGETABLE(CHANGES dbo.quote, @sync_last_received_anchor) CT
			ON CT.[Quote_ID] = dbo.quote.[Quote_ID]
		WHERE (
			CT.SYS_CHANGE_CONTEXT IS NULL OR
			CT.SYS_CHANGE_CONTEXT &lt;&gt; @sync_client_id_binary
		)
	ELSE
	BEGIN
		SELECT dbo.quote.[Quote_ID], [QuoteNumber], [QuoteVersion], [SalesRepFName], [SalesRepLName]
		FROM dbo.quote JOIN CHANGETABLE(CHANGES dbo.quote, @sync_last_received_anchor) CT
			ON CT.[Quote_ID] = dbo.quote.[Quote_ID]
		WHERE (
			CT.SYS_CHANGE_OPERATION = 'I' AND
			CT.SYS_CHANGE_CREATION_VERSION  &lt;= @sync_new_received_anchor AND
			(CT.SYS_CHANGE_CONTEXT IS NULL OR CT.SYS_CHANGE_CONTEXT &lt;&gt; @sync_client_id_binary)
		);
		IF CHANGE_TRACKING_MIN_VALID_VERSION(object_id(N'dbo.quote')) &gt; @sync_last_received_anchor
			RAISERROR (N'SQL Server Change Tracking has cleaned up tracking information for table ''%s''.
			To recover from this error, the client must reinitialize its local database and try again',16,3,N'dbo.quote')
	END
END
</pre>
</div>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://nestorsulikowski.com/wp-content/uploads/2010/01/image4.png" width="411" height="58" /></p>
<h3 id="code5">(5)</h3>
</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:4ddc6a5e-88b5-48a2-8bb3-cdca51f6e785" class="wlWriterEditableSmartContent">
<pre name="code" class="sql">CREATE PROCEDURE ssSelectIncrementalDeletes (
	@sync_initialized bit,
	@sync_last_received_anchor bigint,
	@sync_new_received_anchor bigint,
	@sync_client_id_binary VARBINARY
)
AS
BEGIN
	IF @sync_initialized &gt; 0
	BEGIN
		SELECT CT.[Quote_ID]
		FROM CHANGETABLE(CHANGES dbo.quote, @sync_last_received_anchor) CT
		WHERE (
			CT.SYS_CHANGE_OPERATION = 'D' AND
			CT.SYS_CHANGE_VERSION &lt;= @sync_new_received_anchor AND
			(CT.SYS_CHANGE_CONTEXT IS NULL OR CT.SYS_CHANGE_CONTEXT &lt;&gt; @sync_client_id_binary)
		);
		IF CHANGE_TRACKING_MIN_VALID_VERSION(object_id(N'dbo.quote')) &gt; @sync_last_received_anchor
			RAISERROR (N'SQL Server Change Tracking has cleaned up tracking information for table ''%s''.
			To recover from this error, the client must reinitialize its local database and try again',16,3,N'dbo.quote')
	END
END
</pre>
</div>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://nestorsulikowski.com/wp-content/uploads/2010/01/image5.png" width="95" height="36" /> </p>
</p>
<h3 id="code6">(6)</h3>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:35978978-9b63-486d-ab04-20381811730e" class="wlWriterEditableSmartContent">
<pre name="code" class="sql">CREATE PROCEDURE ssSelectIncrementalUpdates (
	@sync_initialized bit,
	@sync_last_received_anchor bigint,
	@sync_new_received_anchor bigint,
	@sync_client_id_binary VARBINARY
)
AS
BEGIN
	IF @sync_initialized &gt; 0
	BEGIN
		SELECT dbo.quote.[Quote_ID], [QuoteNumber], [QuoteVersion], [SalesRepFName], [SalesRepLName]
		FROM dbo.quote JOIN CHANGETABLE(CHANGES dbo.quote, @sync_last_received_anchor) CT
			ON CT.[Quote_ID] = dbo.quote.[Quote_ID]
		WHERE (
			CT.SYS_CHANGE_OPERATION = 'U' AND
			CT.SYS_CHANGE_VERSION &lt;= @sync_new_received_anchor AND
			(CT.SYS_CHANGE_CONTEXT IS NULL OR CT.SYS_CHANGE_CONTEXT &lt;&gt; @sync_client_id_binary)
		);
		IF CHANGE_TRACKING_MIN_VALID_VERSION(object_id(N'dbo.quote')) &gt; @sync_last_received_anchor
			RAISERROR (N'SQL Server Change Tracking has cleaned up tracking information for table ''%s''.
			To recover from this error, the client must reinitialize its local database and try again',16,3,N'dbo.quote')
	END
END
</pre>
</div>
<h3 id="code7">(7)</h3>
</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:89e27bbc-e545-4e6a-8033-83de8c7db29f" class="wlWriterEditableSmartContent">
<pre name="code" class="sql">CREATE PROCEDURE ssSelectConflictDeletedRows (
	@sync_last_received_anchor bigint,
	@Quote_ID bigint
)
AS
BEGIN
	SELECT CT.[Quote_ID], CT.SYS_CHANGE_CONTEXT, CT.SYS_CHANGE_VERSION
	FROM CHANGETABLE(CHANGES dbo.quote, @sync_last_received_anchor) CT
	WHERE (CT.[Quote_ID] = @Quote_ID AND CT.SYS_CHANGE_OPERATION = 'D')
END
</pre>
</div>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://nestorsulikowski.com/wp-content/uploads/2010/01/image6.png" width="360" height="39" /> </p>
</p>
<h3 id="code8">(8)</h3>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:479cd642-e218-45cd-99e1-01e144814a96" class="wlWriterEditableSmartContent">
<pre name="code" class="sql">CREATE PROCEDURE ssSelectConflictUpdatedRows (
	@Quote_ID bigint
)
AS
BEGIN
	SELECT dbo.quote.[Quote_ID], [QuoteNumber], [QuoteVersion], [SalesRepFName], [SalesRepLName],
		CT.SYS_CHANGE_CONTEXT, CT.SYS_CHANGE_VERSION
	FROM dbo.quote JOIN CHANGETABLE(VERSION dbo.quote, ([Quote_ID]), (@Quote_ID)) CT
		ON CT.[Quote_ID] = dbo.quote.[Quote_ID]
END</pre>
</div>
<h3 id="code9">(9)</h3>
</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:03f78050-93ab-43bb-90a0-9610726d80a2" class="wlWriterEditableSmartContent">
<pre name="code" class="sql">CREATE PROCEDURE ssSelectIncrementalInserts_D (
	@sync_initialized bit,
	@sync_last_received_anchor bigint,
	@sync_new_received_anchor bigint,
	@sync_client_id_binary VARBINARY
)
AS
BEGIN
	IF @sync_initialized = 0
		SELECT dbo.quote.[Quote_ID], [QuoteNumber], [QuoteVersion], [SalesRepFName], [SalesRepLName]
		FROM dbo.quote
	ELSE
	BEGIN
		SELECT dbo.quote.[Quote_ID], [QuoteNumber], [QuoteVersion], [SalesRepFName], [SalesRepLName]
		FROM dbo.quote JOIN CHANGETABLE(CHANGES dbo.quote, @sync_last_received_anchor) CT
			ON CT.[Quote_ID] = dbo.quote.[Quote_ID]
		WHERE (
			CT.SYS_CHANGE_OPERATION = 'I' AND
			CT.SYS_CHANGE_CREATION_VERSION  &lt;= @sync_new_received_anchor AND
			(CT.SYS_CHANGE_CONTEXT IS NULL OR CT.SYS_CHANGE_CONTEXT &lt;&gt; @sync_client_id_binary)
		);
		IF CHANGE_TRACKING_MIN_VALID_VERSION(object_id(N'dbo.quote')) &gt; @sync_last_received_anchor
			RAISERROR (N'SQL Server change tracking has cleaned up tracking information for table ''%s''.
			To recover from this error, the client must reinitialize its local database and try to synchronize again.'
			,16,3,N'dbo.quote')
	END
END
</pre>
</div>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://nestorsulikowski.com/wp-content/uploads/2010/01/image4.png" width="411" height="58" /> </p>
<h3 id="code10">(10)</h3>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:892e83f7-cb7f-4731-8d5d-789a6f4d5264" class="wlWriterEditableSmartContent">
<pre name="code" class="sql">CREATE PROCEDURE ssSelectIncrementalInserts_S
AS
BEGIN
	SELECT dbo.quote.[Quote_ID], [QuoteNumber], [QuoteVersion], [SalesRepFName], [SalesRepLName]
	FROM dbo.quote
	WHERE ( 1=1 )
END
</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://nestorsulikowski.com/index.php/2010/01/sqlsyncadapterbuilder-queries-using-sqlserverchangetracking/feed/</wfw:commentRss>
		<slash:comments>2167</slash:comments>
		</item>
		<item>
		<title>Sync Framework Diagrams: Chapter IV &#8211; CustomProvider With Async Change Tracking</title>
		<link>http://nestorsulikowski.com/index.php/2010/01/sync-framework-diagrams-chapter-iv-customprovider-with-async-change-tracking/</link>
		<comments>http://nestorsulikowski.com/index.php/2010/01/sync-framework-diagrams-chapter-iv-customprovider-with-async-change-tracking/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 15:04:09 +0000</pubDate>
		<dc:creator>nestor</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://nestorsulikowski.com/index.php/2010/01/sync-framework-diagrams-chapter-iv-customprovider-with-async-change-tracking/</guid>
		<description><![CDATA[Same as previous example, but with Asynchronous Tracking. Added 2 new columns to the table Customer: DateModified and DateCreated. Changes in the diagram are marked in red.]]></description>
			<content:encoded><![CDATA[<p>Same as previous example, but with Asynchronous Tracking. Added 2 new columns to the table Customer: DateModified and DateCreated.</p>
<p>Changes in the diagram are marked in <font color="#ff0000">red</font>.</p>
<p><iframe height="600" src="http://deepzoompix.com/DZApp/IFrame.aspx?alias=nsulikow&amp;album=6" frameborder="0" width="800" scrolling="no"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://nestorsulikowski.com/index.php/2010/01/sync-framework-diagrams-chapter-iv-customprovider-with-async-change-tracking/feed/</wfw:commentRss>
		<slash:comments>2130</slash:comments>
		</item>
		<item>
		<title>Sync Framework Diagrams: Chapter III &#8211; CustomProvider</title>
		<link>http://nestorsulikowski.com/index.php/2010/01/sync-framework-diagrams/</link>
		<comments>http://nestorsulikowski.com/index.php/2010/01/sync-framework-diagrams/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 23:57:27 +0000</pubDate>
		<dc:creator>nestor</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://nestorsulikowski.com/index.php/2010/01/sync-framework-diagrams/</guid>
		<description><![CDATA[Custom provider with: At item level, between ReplicaA, ReplicaB and ReplicaC (Sql Databases) Using SqlMetadataProvider Synchronous change tracking The methods not overriden include: GetFullEnumerationChangeBatch (KnowledgeSyncProvider) ProcessFullEnumerationChangeBatch (KnowledgeSyncProvider) SaveChangeWithChangeUnits (INotifyingChangeApplierTarget) SaveConflict (INotifyingChangeApplierTarget)]]></description>
			<content:encoded><![CDATA[<p>Custom provider with:</p>
<ul>
<li>At item level, between ReplicaA, ReplicaB and ReplicaC (Sql Databases) </li>
<li>Using SqlMetadataProvider </li>
<li>Synchronous change tracking </li>
</ul>
<p>The methods not overriden include:</p>
<ul>
<li><strong>GetFullEnumerationChangeBatch</strong> (KnowledgeSyncProvider) </li>
<li><strong>ProcessFullEnumerationChangeBatch</strong> (KnowledgeSyncProvider) </li>
<li><strong>SaveChangeWithChangeUnits </strong>(INotifyingChangeApplierTarget) </li>
<li><strong>SaveConflict</strong> (INotifyingChangeApplierTarget) </li>
</ul>
<p><iframe height="600" src="http://deepzoompix.com/DZApp/IFrame.aspx?alias=nsulikow&amp;album=5" frameborder="0" width="800" scrolling="no"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://nestorsulikowski.com/index.php/2010/01/sync-framework-diagrams/feed/</wfw:commentRss>
		<slash:comments>1229</slash:comments>
		</item>
		<item>
		<title>Protected: SAMOA Assemblies</title>
		<link>http://nestorsulikowski.com/index.php/2010/01/samoa-assemblies/</link>
		<comments>http://nestorsulikowski.com/index.php/2010/01/samoa-assemblies/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 02:54:44 +0000</pubDate>
		<dc:creator>nestor</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://nestorsulikowski.com/index.php/2010/01/samoa-assemblies/</guid>
		<description><![CDATA[There is no excerpt because this is a protected post.]]></description>
			<content:encoded><![CDATA[<form action="http://nestorsulikowski.com/wp-pass.php" method="post">
<p>This post is password protected. To view it please enter your password below:</p>
<p><label for="pwbox-1038">Password:<br />
<input name="post_password" id="pwbox-1038" type="password" size="20" /></label><br />
<input type="submit" name="Submit" value="Submit" /></p></form>
]]></content:encoded>
			<wfw:commentRss>http://nestorsulikowski.com/index.php/2010/01/samoa-assemblies/feed/</wfw:commentRss>
		<slash:comments>65</slash:comments>
		</item>
		<item>
		<title>Protected: Add-SeriesSets</title>
		<link>http://nestorsulikowski.com/index.php/2009/12/add-seriessets/</link>
		<comments>http://nestorsulikowski.com/index.php/2009/12/add-seriessets/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 20:51:45 +0000</pubDate>
		<dc:creator>nestor</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://nestorsulikowski.com/index.php/2009/12/add-seriessets/</guid>
		<description><![CDATA[There is no excerpt because this is a protected post.]]></description>
			<content:encoded><![CDATA[<form action="http://nestorsulikowski.com/wp-pass.php" method="post">
<p>This post is password protected. To view it please enter your password below:</p>
<p><label for="pwbox-1028">Password:<br />
<input name="post_password" id="pwbox-1028" type="password" size="20" /></label><br />
<input type="submit" name="Submit" value="Submit" /></p></form>
]]></content:encoded>
			<wfw:commentRss>http://nestorsulikowski.com/index.php/2009/12/add-seriessets/feed/</wfw:commentRss>
		<slash:comments>67</slash:comments>
		</item>
		<item>
		<title>Protected: Internal path resolution method</title>
		<link>http://nestorsulikowski.com/index.php/2009/11/internal-path-resolution-method/</link>
		<comments>http://nestorsulikowski.com/index.php/2009/11/internal-path-resolution-method/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 21:39:49 +0000</pubDate>
		<dc:creator>nestor</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://nestorsulikowski.com/index.php/2009/11/internal-path-resolution-method/</guid>
		<description><![CDATA[There is no excerpt because this is a protected post.]]></description>
			<content:encoded><![CDATA[<form action="http://nestorsulikowski.com/wp-pass.php" method="post">
<p>This post is password protected. To view it please enter your password below:</p>
<p><label for="pwbox-1017">Password:<br />
<input name="post_password" id="pwbox-1017" type="password" size="20" /></label><br />
<input type="submit" name="Submit" value="Submit" /></p></form>
]]></content:encoded>
			<wfw:commentRss>http://nestorsulikowski.com/index.php/2009/11/internal-path-resolution-method/feed/</wfw:commentRss>
		<slash:comments>44</slash:comments>
		</item>
		<item>
		<title>Protected: terranostrajewelry.com</title>
		<link>http://nestorsulikowski.com/index.php/2009/10/terranostrajewelrycom/</link>
		<comments>http://nestorsulikowski.com/index.php/2009/10/terranostrajewelrycom/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 20:30:27 +0000</pubDate>
		<dc:creator>nestor</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://nestorsulikowski.com/index.php/2009/10/terranostrajewelrycom/</guid>
		<description><![CDATA[There is no excerpt because this is a protected post.]]></description>
			<content:encoded><![CDATA[<form action="http://nestorsulikowski.com/wp-pass.php" method="post">
<p>This post is password protected. To view it please enter your password below:</p>
<p><label for="pwbox-1012">Password:<br />
<input name="post_password" id="pwbox-1012" type="password" size="20" /></label><br />
<input type="submit" name="Submit" value="Submit" /></p></form>
]]></content:encoded>
			<wfw:commentRss>http://nestorsulikowski.com/index.php/2009/10/terranostrajewelrycom/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>SQL 2008 &#8211; MERGE T-SQL</title>
		<link>http://nestorsulikowski.com/index.php/2009/09/sql-2008-merge-t-sql/</link>
		<comments>http://nestorsulikowski.com/index.php/2009/09/sql-2008-merge-t-sql/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 19:09:31 +0000</pubDate>
		<dc:creator>nestor</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://nestorsulikowski.com/index.php/2009/09/sql-2008-merge-t-sql/</guid>
		<description><![CDATA[A picture is worth a thousand words (if you understand the picture that is…)]]></description>
			<content:encoded><![CDATA[<p>A picture is worth a thousand words (if you understand the picture that is…)</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="TSQL_MERGE" border="0" alt="TSQL_MERGE" src="http://nestorsulikowski.com/wp-content/uploads/2009/09/tsql-merge.jpg" width="676" height="408" /></p>
]]></content:encoded>
			<wfw:commentRss>http://nestorsulikowski.com/index.php/2009/09/sql-2008-merge-t-sql/feed/</wfw:commentRss>
		<slash:comments>2697</slash:comments>
		</item>
	</channel>
</rss>

