KNOWLEDGE BASE

HASHBYTES Function Does Not Return a Field


Published: 17 Mar 2022
Last Modified Date: 19 Mar 2022

Issue

The HASHBYTES function in custom SQL does not return a field.

Environment

  • Tableau Prep Builder 2021.4.3
  • MS SQL Server

Resolution

As a workaround, wrap the HASHBYTES function within a CONVERT() function, converting it to NVARCHAR(32).

For example:
SELECT CONVERT(NVCHAR(32), HASHBYTES('MD5' , Column_Name),2) AS Column_Name;

Cause

This issue, ID 1372178, is currently under investigation.
Did this article resolve the issue?