how to encrypt and decrypt password in sql server 2008 usin function I want to learn how can I perform encryption through sql server function which can be achieved by writing codes in Sql Server "Query Page" Please help
Hi Sadakat,
Refer the below test query.
DECLARE @encrypt VARBINARY(200) SELECT @encrypt = ENCRYPTBYPASSPHRASE('key', 'abc') SELECT @encrypt 'EncryptValue' SELECT CONVERT(VARCHAR(100),DECRYPTBYPASSPHRASE('key', @encrypt )) 'DecryptValue'
Screenshot
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.