Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all articles
Browse latest Browse all 935

Microsoft SQL Server INFORMATION_SCHEMA.COLUMNS CHARACTER_MAXIMUM_LENGTH is NULL

$
0
0

I am trying to get maximum allowed column length (characters count in representation, not bytes count) from MS SQL from INFORMATION_SCHEMA.COLUMNS table. I have found that CHARACTER_MAXIMUM_LENGTH can be NULL for numeric and datetime types. I also have found three following columns in INFORMATION_SCHEMA.COLUMNS table:

  1. NUMERIC_PRECISION;
  2. NUMERIC_SCALE (related to NUMERIC_PRECISION);
  3. DATETIME_PRECISION;

As i understand there is always at least on non NULL value of column exists, so we can use that columns to get maximum length. I can`t found clear specification about this columns usage. For example lets say i have DATETIME_PRECISION equals 3 for datetime type, how i can calculate characters count from that '3' using only INFORMATION_SCHEMA tables?


Viewing all articles
Browse latest Browse all 935

Trending Articles