Suppose that I have a SQL table that has a varchar[1000] field called \"Remarks\".
I would like to craft a single SQL statement, which when executed, will return 100
select column_name, data_type, character_maximum_length
from INFORMATION_SCHEMA.COLUMNS
where table_name = 'Table1'
For SQL Server (2008 and above):
SELECT COLUMNPROPERTY(OBJECT_ID('mytable'), 'Remarks', 'PRECISION');
COLUMNPROPERTY returns information for a column or parameter (id, column/parameter, property). The PRECISION property returns the length of the data type of the column or parameter.
COLUMNPROPERTY documentation