SyncFramework同步锚未正确转换为有效的DateTime字符串

时间:2010-02-05 17:07:47

标签: c# sql-server microsoft-sync-framework

我正在使用SyncFramework 1.0将SqlCe 2005数据库与SqlServer 2005同步。

我正在设置这样的Sync锚......

 CommandText = "Select @sync_new_received_anchor = GETUTCDATE()",

但是syncframework将此值转换为具有太多小数位的字符串....

exec sp_executesql N'SELECT [Company], [ServiceAreaId], [CostCentreId], [DeletionDate], [DeletionId] 
FROM [ServiceArea_CostCentre_Tombstone] 
WHERE (@sync_initialized = 1 
AND DeletionDate > @sync_last_received_anchor 
AND DeletionDate <= @sync_new_received_anchor 
AND DeletionId <> @sync_client_id)',
N'@sync_initialized bit,@sync_last_received_anchor datetime,
  @sync_new_received_anchor datetime,@sync_client_id uniqueidentifier',
  @sync_initialized=1,
@sync_last_received_anchor='2010-01-27 10:22:01.6770000', -- something wrong here!
@sync_new_received_anchor='2010-01-27 10:23:48.5500000',
@sync_client_id='04F8DB17-981A-4A66-9126-BB609342A2A5'

Sql server记录错误“将数据类型varchar转换为datetime时出错”。因为它在将字符串转换为DateTime时只允许三位小数。

我不知道出了什么问题!

0 个答案:

没有答案