有没有办法从时间戳类型列中获取 DateTime 值? [英] Is there a way to get DateTime value from timestamp type column?

查看:31
本文介绍了有没有办法从时间戳类型列中获取 DateTime 值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要从表中进行选择,该表没有指示何时插入行的列,只有 timestamp 列(值如:0x0000000000530278).昨天将一些数据导入表中,现在我需要找出究竟导入了什么:(

I need a select from table which does not have column that tells when row was inserted, only timestamp column (values like: 0x0000000000530278). Some data was imported to the table yesterday and now I need to find out what exactly was imported :(

有没有办法只使用 timestamp 信息来做到这一点?这里我发现:

Is there a way to do it using only timestamp info? Here I found that:

  • 时间戳是一个 8 字节的连续十六进制数,与日期和时间无关.
  • 要获取时间戳的当前值,请使用:@@DBTS.

也许有一种方法可以找到特定时间附近的 timestamp 值?这将有助于形成一个选择.或者也许有一个众所周知的解决方案?

Perhaps there is a way to find what was timestamp value around specific time? That would help to form a select. Or maybe there is a well known solution?

推荐答案

Transact-SQL 时间戳数据类型是一种二进制数据类型,没有与时间相关的值.

The Transact-SQL timestamp data type is a binary data type with no time-related values.

所以回答你的问题:有没有办法从时间戳类型列中获取 DateTime 值?

答案是:没有

这篇关于有没有办法从时间戳类型列中获取 DateTime 值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆