HASHBYTES
cryptographic transform or key lookup
What changes
- Input
- plaintext or ciphertext and a key, certificate or passphrase
- Output or change
- ciphertext, plaintext, hash, signature check, or key metadata
- Return type
- varbinary (maximum 8000 bytes)
Syntax at a glance
HASHBYTES ( '<algorithm>', { @input | 'input' } )
Work example
Compute a supported digest for integrity comparison in an existing data workflow.
Use a current approved hash algorithm and never store passwords with HASHBYTES.
Check your work A digest is not encryption and does not protect a low-entropy secret from guessing.
Open Microsoft Learn for full syntax, permissions, and details for your version.