Max size of data to be encrypted

long 116 Reputation points
2021-04-12T21:57:40.93+00:00

Max size of data decrypted by CONVERT(varchar, DecryptByKey(encripted_data)) is only 30?

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,767 questions
{count} votes

Accepted answer
  1. Erland Sommarskog 101.4K Reputation points MVP
    2021-04-12T22:05:23.473+00:00

    Yes. Since you don't specify any length, you get a default of 30. With CONVERT, I should hasten to add. If you say

    DECLARE @VAR varchar

    you get varchar(1).

    So always specify the length explicitly!

    2 people found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful