Home All Groups Group Topic Archive Search About
Author
15 Dec 2005 4:26 PM
guy
I am building a .NET app that uses sqlDataReader.GetSchemaTable method. this
returns a table which includes the column "Provider Type" which is the
database data type of the column, however it is a numeric value, are the
mappings between these numeric values and the textual data type names
documented anywhere?

eg Money appears to be 9
and Date appears to be 15

Author
15 Dec 2005 5:26 PM
Mark Williams
For SQL Server 2000, the systypes system table contains mappings between the
data type name and a number called 'xtype'. They don't seem to line up with
your observations though.

xtype Data type name           
----- -------------------------
34    image                   
35    text                    
36    uniqueidentifier        
48    tinyint                 
52    smallint                
56    int                     
58    smalldatetime           
59    real                    
60    money                   
61    datetime                
62    float                   
98    sql_variant             
99    ntext                   
104   bit                     
106   decimal                 
108   numeric                 
122   smallmoney              
127   bigint                  
165   varbinary               
167   varchar                 
173   binary                  
175   char                    
189   timestamp               
231   sysname                 
231   nvarchar                
239   nchar


Show quote
"guy" wrote:

> I am building a .NET app that uses sqlDataReader.GetSchemaTable method. this
> returns a table which includes the column "Provider Type" which is the
> database data type of the column, however it is a numeric value, are the
> mappings between these numeric values and the textual data type names
> documented anywhere?
>
> eg Money appears to be 9
> and Date appears to be 15
>
Author
16 Dec 2005 11:37 AM
guy
Mark,
hmmm interesting, so far i have found:-
2  bit
3  char
6  float
8  Int
9  money
15 smalldatetime
16 smallint
22 varchar

cheers

Show quote
"Mark Williams" wrote:

> For SQL Server 2000, the systypes system table contains mappings between the
> data type name and a number called 'xtype'. They don't seem to line up with
> your observations though.
>
> xtype Data type name           
> ----- -------------------------
> 34    image                   
> 35    text                    
> 36    uniqueidentifier        
> 48    tinyint                 
> 52    smallint                
> 56    int                     
> 58    smalldatetime           
> 59    real                    
> 60    money                   
> 61    datetime                
> 62    float                   
> 98    sql_variant             
> 99    ntext                   
> 104   bit                     
> 106   decimal                 
> 108   numeric                 
> 122   smallmoney              
> 127   bigint                  
> 165   varbinary               
> 167   varchar                 
> 173   binary                  
> 175   char                    
> 189   timestamp               
> 231   sysname                 
> 231   nvarchar                
> 239   nchar
>
>
> "guy" wrote:
>
> > I am building a .NET app that uses sqlDataReader.GetSchemaTable method. this
> > returns a table which includes the column "Provider Type" which is the
> > database data type of the column, however it is a numeric value, are the
> > mappings between these numeric values and the textual data type names
> > documented anywhere?
> >
> > eg Money appears to be 9
> > and Date appears to be 15
> >

AddThis Social Bookmark Button