I have a field which has been set to max size. How can i find the max size occupied by the field.
For example if the records are for table TableA
FieldA
123
abcd
1234567
I need to know which row occupied the most size and what the size is, how?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
LEN tests for the length in characters, e.g. “a” = 1 char
DATALENGTH checks for the size in bytes, an NVarchar occupies 2 bytes per character
To get all the rows in the table that have the maximum length of data in FieldA,