Max size of data decrypted by CONVERT(varchar, DecryptByKey(encripted_data)) is only 30?
Max size of data decrypted by CONVERT(varchar, DecryptByKey(encripted_data)) is only 30?
Hi,
When n isn't specified in a data definition or variable declaration statement, the default length is 1. If n isn't specified when using the CAST and CONVERT functions, the default length is 30.
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!
12 people are following this question.