<p>I have a column which is of type nvarchar(max).  How do I find the length of the string (or the number of bytes) for the column for each row in the table?</p>

[{'answer_id': 36590, 'author': 'Brian R. Bondy', 'author_id': 3153, 'author_profile': 'https://Stackoverflow.com/users/3153', 'pm_score': 6, 'selected': True, 'text': '<blockquote>\n  <p>SELECT LEN(columnName) AS MyLength\n  FROM myTable</p>\n</blockquote>\n'}, {'answer_id': 36592, 'author': 'Joseph Pecoraro', 'author_id': 792, 'author_profile': 'https://Stackoverflow.com/users/792', 'pm_score': 1, 'selected': False, 'text': '<p>If you want to find out the max there should be a way for you to get the schema of the table.  Normally you can do something like <a href="http://dev.mysql.com/doc/refman/5.0/en/show-columns.html" rel="nofollow noreferrer">SHOW COLUMNS</a> in SQL or a <a href="http://dev.mysql.com/doc/refman/5.0/en/describe.html" rel="nofollow noreferrer">DESCRIBE</a> style command.  In a mysql shell that can be shortened to:</p>\n\n<pre><code>desc tablename;\n</code></pre>\n\n<p>Then if you want to determine the length of a string there is normally a function like <a href="http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_length" rel="nofollow noreferrer">LENGTH</a> <em>(for bytes)</em> or <a href="http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_char-length" rel="nofollow noreferrer">CHAR_LENGTH</a> <em>(for characters)</em>.</p>\n\n<pre><code>SELECT *, LENGTH(fieldname) AS len FROM tablename\n</code></pre>\n'}, {'answer_id': 2943468, 'author': 'sivasankar', 'author_id': 354574, 'author_profile': 'https://Stackoverflow.com/users/354574', 'pm_score': 1, 'selected': False, 'text': '<pre><code>SELECT LEN(columnName) AS MyLength FROM myTable\n</code></pre>\n\n<p>I used this query for my table. It displays the size of each row in a particular column.</p>\n\n<p>I need that field name size maximum it allow the characters.</p>\n'}]
['https://Stackoverflow.com/questions/36585', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1208/']