2

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

我正在像这样设置同步锚...

 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 时,它​​只允许小数点后三位。

我不知道出了什么问题!

4

0 回答 0