简体   繁体   English

SQL Server中的TimeStamp和DateTime有什么区别?

[英]What is the difference between TimeStamp and DateTime in SQL Server?

In SQL Server, there is the TimeStamp type, when should I use it or not instead of simply DateTime? 在SQL Server中,存在TimeStamp类型,何时应该使用它而不是简单地使用DateTime?

What is use for TimeStamp? 时间戳记有什么用? I've heard it is to guarantee that the datetime won't be changed, like a stamp. 我听说这是要保证日期时间不会改变,就像盖章一样。 Is it? 是吗?

timestamp is automatically generated and unique. 时间戳是自动生成的并且是唯一的。 This is deprecated. 不推荐使用。

Note from Microsoft 微软的注解

The timestamp syntax is deprecated. 不建议使用时间戳语法。 This feature will be removed in a future version of Microsoft SQL Server. 将来的Microsoft SQL Server版本将删除此功能。 Avoid using this feature in new development work, and plan to modify applications that currently use this feature. 避免在新的开发工作中使用此功能,并计划修改当前使用此功能的应用程序。

datetime is a data type that handles dates and times datetime是处理日期和时间的数据类型

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM