在SSRS矩阵中显示Hashbytes值

时间:2017-09-01 13:17:26

标签: sql sql-server reporting-services ssrs-2008

我有一个简单的查询,我试图在SSRS矩阵中显示hashbytes值 - 这会在渲染矩阵时抛出错误

我的查询

    select  hashbytes('md5',Consultant_Code) as Consultant_Code, 
    hashbytes('md5',Surgeon1_Code) as Surgeon_Code
    from TheatreOps

当这在预览视图中呈现时,它会显示#Error,我希望看到该值,有人之前有过这个吗,可能会建议修复吗?

2 个答案:

答案 0 :(得分:2)

使用以下

gcc [filename] -o [name of the created executable]

答案 1 :(得分:0)

SSRS处理返回的数据类型(varbinary)可能是个问题。

尝试:

select  cast(hashbytes('md5',Consultant_Code) as varchar) as Consultant_Code, 
        cast(hashbytes('md5',Surgeon1_Code) as varchar) as Surgeon_Code
from TheatreOps