April 28, 2010 at 2:13 pm
The INFORMATION.SCHEMA.COLUMNS view has a column called DATA_TYPE. BOL doesn't list all the potential values. Does anyone know of one? I do need that list for a project I'm working on.
The DATA_TYPE column lists the system-supplied data type name of a table column. The DATA_TYPE column is an nvarchar(128) column. So the data type names are character names such as "nvarchar", "varchar" and so forth.
With a list of these values, one could do some conditional matching - which is what I intend to do.
So, if anyone knows of a comprehensive list of these values, that's what I'm looking for. Thanks!
Bill N.
Bill Nicolich: www.SQLFave.com.
Daily tweet of what's new and interesting: AppendNow
April 28, 2010 at 5:24 pm
The nvarchar(128) is the defined type and length for identifiers (see BOL, section "identifiers [SQL Server]")
I would use the allowed tpes as described for base_types when creating a user-defined type (BOL, section "create type"). One thing I'm not sure about: whether the name of the user-defined data type is stored in this table or the base type (I'd expect the base_type but I would test it first if needed...).
April 29, 2010 at 3:34 am
April 29, 2010 at 8:31 am
Paul White NZ (4/29/2010)
SELECT name
FROM sys.types;
Paul: That looks right! How did you find it?
Apparently the data type values themselves aren't specified in the ISO standard - so, vendors will differ. For instance, Microsoft uses the bit column which is vendor-specific.
Bill Nicolich: www.SQLFave.com.
Daily tweet of what's new and interesting: AppendNow
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply