EncryptByPassPhrase depends on datatype?

  • Can i use EncryptByPassPhrase for column of any datatype? I tried it for using integer,varchar and nvarchar. it worked properly. But when i use it for column of type nchar(10) i am getting error

    Msg 8152, Level 16, State 5, Line 1

    String or binary data would be truncated.

    The statement has been terminated.

    In the article http://technet.microsoft.com/en-us/library/ms190357(v=sql.105).aspx it is used only for varbinary. Does it can be used for any type of column because it is working for integer,varchar and nvarchar. Please clarify my doubts.

    Thank you

  • You can encrypt

    @cleartext

    A variable of type nvarchar, char, varchar, binary, varbinary, or nchar containing the cleartext.

    Maximum size is 8,000 bytes.

    ENCRYPTBYPASSPHRASE return varbinary value

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply