【问题标题】:Compare a byte[] or a Base64String to a T-SQL timestamp将 byte[] 或 Base64String 与 T-SQL 时间戳进行比较
【发布时间】:2013-10-17 10:43:12
【问题描述】:

如何比较像这样的东西:AAAAAA1iUFw=(从字节数组转换的 Base64String)和像这样的东西 0x000000000BFF1E5A(T-SQL)?

我想通过这个 base64String 找到 tablerow,比如:

select * from table1 where timestampCol = 'AAAAAA1iUFw='

【问题讨论】:

  • 为什么要这么做?它们应该如何匹配?
  • 因为我通过调试得到了时间戳,想和数据库表查找/比较

标签: c# tsql timestamp base64


【解决方案1】:

将值转换为 varbinay 会有所帮助:

-- Convert Base64 value to varbinary 
select cast ('AAAAAA1iUFw=' as varbinary(20))

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-10-29
    • 2017-07-02
    • 1970-01-01
    • 1970-01-01
    • 2016-01-27
    • 1970-01-01
    • 2018-04-11
    相关资源
    最近更新 更多