SQL Server BIT field type

644
3
Jump to solution
03-30-2020 03:21 PM
jaykapalczynski
Frequent Contributor

I have a table that was put together in SQL Server with a bunch of BIT field types...

I am not bring that into SDE

Although when you create a table in SDE there is no BIT field data type....only short integer....

How is this dealt with....I basically want a form that will have a check box...the field behind will either be checked or not checked....

how do I lay this out? ideas / thoughts

0 Kudos
1 Solution

Accepted Solutions
JoshuaBixby
MVP Esteemed Contributor

The SQL Server specific documentation, DBMS data types supported in ArcGIS—Help | Documentation , covers this topic somewhat/mostly.

For SQL Server, bit data types are mapped to Esri Short integer (along with SQL Server smallint and tinyint).  In ArcGIS Pro, it will show the field type as Short, but it will only allow you to put 0/1 into the field.  From my experience, any non-zero value gets converted to 1 when the data is updated into the DBMS.

View solution in original post

3 Replies
George_Thompson
Esri Frequent Contributor

I am not sure that you can have a check box in a geodatabase field, but here is the doc on the field types: ArcGIS field data types—Geodatabases | Documentation 

--- George T.
jaykapalczynski
Frequent Contributor

Thanks...for what its worth...not trying to put a check box in a geodatabase field....rather I have a .net form that has a bunch of check boxes on it...right now its feeding a SQL table with a bit field type.  This is being brought into SDE which does not have a specified BIT field type...but short integer should work.....this is what I was getting at...

When submit is done on the form I would simply check for checked or not and then apply a 0 or 1 to that short integer field....just a bit more code handling...

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

The SQL Server specific documentation, DBMS data types supported in ArcGIS—Help | Documentation , covers this topic somewhat/mostly.

For SQL Server, bit data types are mapped to Esri Short integer (along with SQL Server smallint and tinyint).  In ArcGIS Pro, it will show the field type as Short, but it will only allow you to put 0/1 into the field.  From my experience, any non-zero value gets converted to 1 when the data is updated into the DBMS.