开发者

Convert date to ticks in SQL Server

开发者 https://www.devze.com 2022-12-31 03:08 出处:网络
Does anyone know how to convert a DATETIM开发者_StackOverflow社区E COLUMN to TICKS in SQL Server?If you are trying to have t-sql convert a value to ticks that can be compared with the \"same\" value c

Does anyone know how to convert a DATETIM开发者_StackOverflow社区E COLUMN to TICKS in SQL Server?


If you are trying to have t-sql convert a value to ticks that can be compared with the "same" value created in .NET it will not work. A DateTime data type in SQL Server only has a precision of about .003 seconds (actually values are rounded to .000, .003 or .007) or 10-3 whereas a DateTime data type in .NET has a precision of 100 nanoseconds (10-7).

0

精彩评论

暂无评论...
验证码 换一张
取 消