0

I have been trying trying to create a table and use CRC64 function on my table using MS Notebook, but getting the error. This function is neither a registered temporary function nor a permanent function registered in the database

Any suggestions how to fix this ?

enter image description here

select
CONCAT_WS('|',date,fullvisitorid,visitid,'${hivevar:sourceIDSplit}','${hivevar:sourceSchemaID}') AS test_skey
,CRC64(CONCAT_WS('|',date,fullvisitorid,visitid,'${hivevar:sourceIDSplit}','${hivevar:sourceSchemaID}')) AS test_skey_bigint
,*
,'${batchrunID}' AS batchrun_date
,'${sourceID}' AS source_schema_id
from vw_wom_3;
Roho
  • 101
  • 10
  • there is no built in CRC hash function in sql server cloud nor on-premises . – eshirvana Aug 13 '21 at 15:14
  • Does this answer your question? [Does SQL Server CheckSum calculate a CRC? If not how can I get MS SQL to calculate a CRC on an arbitrary varchar column?](https://stackoverflow.com/questions/331157/does-sql-server-checksum-calculate-a-crc-if-not-how-can-i-get-ms-sql-to-calcula) – eshirvana Aug 13 '21 at 15:14

1 Answers1

1

I tried to repro the scenario and could fetch the same error for CRC64 using MS Notebook as well if I try it in SQL query editor. It seems to be working perfectly fine for CRC32 using Notebook or in SQL Query Editor.

Hence, Could not find any built-ins for the CRC Hash function in Azure SQL

Using MS Notebook:

enter image description here

Using Azure SQL Query Editor:

enter image description here

However, You can use any other programming language VB or C# to implement the same or to use Microsoft has made a tool called "File Checksum Integrity Verifier" available.

Microsoft File Checksum Integrity Verifier Utility: Available Here.

It claims to run on Windows 2000, XP, and Server 2003, but I've tested it with Win7 64-bit and it generates CRC, so I assume it works on later Windows as well.

IpsitaDash-MT
  • 1,326
  • 1
  • 3
  • 7