-
Hi all, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Because your comparison is (I take var setup = new SyncSetup(new string[] { "ProductCategory" });
// Create a filter on table ProductCategory
var productCategoryFilter = new SetupFilter("ProductCategory");
// Parameter ModifiedDate mapped to the ModifiedDate column
// Allow Null = true
productCategoryFilter.AddParameter("ModifiedDate", "ProductCategory", true);
// Since we are using a >= in the query, we should use a custom where
productCategoryFilter.AddCustomWhere("base.ModifiedDate >= @ModifiedDate Or @ModifiedDate Is Null"); The generated SQL will be ALTER PROCEDURE [dbo].[ProductCategory_ModifiedDate_changes]
@sync_min_timestamp bigint = 0,
@sync_scope_id uniqueidentifier = NULL,
@ModifiedDate datetime = NULL
AS
BEGIN
SELECT DISTINCT [side].[ProductCategoryID],
[base].[ParentProductCategoryID],
[base].[Name],
[base].[rowguid],
[base].[ModifiedDate],
[side].[sync_row_is_tombstone],
[side].[update_scope_id]
FROM [ProductCategory] [base]
RIGHT JOIN [ProductCategory_tracking] [side] ON [base].[ProductCategoryID] = [side].[ProductCategoryID]
WHERE (
(
base.ModifiedDate >= @ModifiedDate Or @ModifiedDate Is Null
)
AND
[side].[timestamp] > @sync_min_timestamp
AND ([side].[update_scope_id] <> @sync_scope_id OR [side].[update_scope_id] IS NULL)
)
END Be careful, this technic does not work with |
Beta Was this translation helpful? Give feedback.
-
Note, though, that in this case,
Please keep those constellations in mind! |
Beta Was this translation helpful? Give feedback.
Because your comparison is
>=
, you need to use theAddCustomWhere
method, like this:(I take
ProductCategory
as my table and I want to create a filter on columnModifiedDate
)The generated SQL wi…