Sunday, March 11, 2012

'EncryptByPassPhrase' is not a recognized function name.

I am trying to run the following code in SQL Server 2005:

DECLARE @.cleartext NVARCHAR(100)

DECLARE @.encryptedstuff NVARCHAR(100)

DECLARE @.decryptedstuff NVARCHAR(100)

SET @.cleartext = 'XYZ'

SET @.encryptedstuff = EncryptByPassPhrase('12345', @.cleartext)

SELECT @.encryptedstuff

SET @.decryptedstuff = DecryptByPassphrase('12345', @.encryptedstuff)

SELECT @.decryptedstuff

and am recieving an error:

Msg 195, Level 15, State 10, Line 5

'EncryptByPassPhrase' is not a recognized function name.

Msg 195, Level 15, State 10, Line 7

'DecryptByPassphrase' is not a recognized function name.

It appears as though this EncryptByPassPhrase and DecryptByPassphrase as supported in 2005 T-SQL commands but when I execute this code in SQL Server Studio it errors out.

Anyone know why?

What's the compatibility level of your database?

No comments:

Post a Comment