Bug report #5283

MS SQL provider doesn't save data or datetime

Added by Nathan Woodrow over 12 years ago. Updated over 12 years ago.

Status:Closed
Priority:High
Assignee:Tamas Szekeres
Category:Data Provider
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:15003

Description

When using a table with a date field, trying to save the record back the feature is removed from the map canvas and this error is reported in the error log

[1444] QODBCResult::exec: Unable to execute statement: "[Microsoft][ODBC SQL Server Driver][SQL Server]Implicit conversion from data type varbinary to date is not allowed. Use the CONVERT function to run this query. [Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not be prepared." 
[1444] d:\\src\\qgis\\src\\providers\\mssql\\qgsmssqlprovider.cpp(800) : (QgsMssqlProvider::addFeatures) [Microsoft][ODBC SQL Server Driver][SQL Server]Implicit conversion from data type varbinary to date is not allowed. Use the CONVERT function to run this query. [Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not be prepared. QODBC3: Unable to execute statement

Steps to reproduce:
  • Create layer in MS SQL with date field
  • Open table
  • Add feature
  • Save feature

Related issues

Related to QGIS Application - Bug report #5284: MS SQL features disappear if SQL errors on insert Closed 2012-04-02

Associated revisions

Revision 4a9e8ccb
Added by Tamas Szekeres over 12 years ago

MSSQL:Improve handling of datetime types (fixes #5283)

Also available in: Atom PDF