2015-04-02 62 views
0

在SQL Server中,有TimeStamp类型,我应该何时使用它或不使用DateTime?SQL Server中TimeStamp和DateTime有什么区别?

TimeStamp有什么用?我听说这是为了保证日期时间不会改变,就像邮票一样。是吗?

+1

这很可能停课时[这]一式两份(http://stackoverflow.com/questions/7698707/timestamp-and-数据类型datetime),[this](http://stackoverflow.com/questions/8665548/sql-server-2008-timestamp-data-type),[this](http://stackoverflow.com/questions/7154742/how- do-i-get-date-time-information-from-a-timestamp-column)... – 2015-04-02 01:00:53

回答

2

时间戳是自动生成和唯一的。这已被弃用。

注意从Microsoft

时间戳语法已被弃用。此功能将在 未来版本的Microsoft SQL Server中删除。避免在 新开发工作中使用此功能,并计划修改当前使用此功能的 应用程序。

日期时间是处理日期和时间

+0

他们为什么要删除它? – 2015-04-02 01:07:01

+0

可能是因为它是rowversion的同义词。 – WorkSmarter 2015-04-02 01:10:27

相关问题