有没有办法将 nullubule Timstamp2 设置回 null?
Is there a way to set a nullubule Timstamp2 back on null?
我在 table 中有一个 nullubule 时间戳,用于跟踪客户端调用条目的时间。有时客户端出现问题,我需要将时间戳设置回 null。我直接在 SQL management studio 中尝试执行查询:
USE [MyDB]
GO
UPDATE [dbo].[MyTable]
SET [MyTimestamp]=null
WHERE ID=SomeInt;
我收到一条消息,其中一行已更改,但是当我在 table 上刷新我的 select * 时,时间戳没有变化。
PS:整个数据库在 azure 服务器上运行,但我也无法让它在 SQL Server 2014 中本地主机上的测试数据库上运行。
不胜感激
答案是你cannot将时间戳列更改为 NULL。它就像一行版本号。
还有
The timestamp data type is just an incrementing number and does not
preserve a date or a time.
有一些变通方法可以作为 related thread 此处使用的变通方法,但现在很少使用时间戳数据类型。
我在 table 中有一个 nullubule 时间戳,用于跟踪客户端调用条目的时间。有时客户端出现问题,我需要将时间戳设置回 null。我直接在 SQL management studio 中尝试执行查询:
USE [MyDB]
GO
UPDATE [dbo].[MyTable]
SET [MyTimestamp]=null
WHERE ID=SomeInt;
我收到一条消息,其中一行已更改,但是当我在 table 上刷新我的 select * 时,时间戳没有变化。
PS:整个数据库在 azure 服务器上运行,但我也无法让它在 SQL Server 2014 中本地主机上的测试数据库上运行。
不胜感激
答案是你cannot将时间戳列更改为 NULL。它就像一行版本号。
还有
The timestamp data type is just an incrementing number and does not preserve a date or a time.
有一些变通方法可以作为 related thread 此处使用的变通方法,但现在很少使用时间戳数据类型。