id summary reporter owner description type status priority milestone component version severity resolution keywords cc 6235 MSSpatial (when connecting to SQL Server) set varchar primary keys as FID integer robe tamas "I haven't tested this on lower and maybe this is the first time I've tried to query a table that didn't have an integer for primary key. If my table has a primary key and that column is say a varchar(50), then ogr_info and friends map it to FID but set it as an integer, so all the values end up coming back as 0. So to work around the issue I always have to take off the primary key. I thought it may be a general ODBC issue, but I tried it on an MS Access db with a table that has a varchar field and it doesn't try to map it to FID. For perspective here is an example OGR info output from a SQL Server 2008 R2. I get the same behavior with both ODBC and MSSpatial driver That pgName field is the primary key and if I remove the primary key, then it comes thru as a regular old field. {{{ Layer name: dbo.PersGroups Geometry: Unknown (any) Feature Count: 11 Layer SRS WKT: (unknown) FID Column = pgName pgRights: String (0.0) pgTemplates: String (1000.0) pgRecordSchedule: String (2000.0) pgParentName: String (50.0) OGRFeature(dbo.PersGroups):0 pgRights (String) = *AllRights pgTemplates (String) = (null) pgRecordSchedule (String) = (null) pgParentName (String) = (null) }}} " defect closed normal 2.0.2 default 2.0.1 major fixed mssql