Skip to content
Permalink
Browse files
[MSSQL] Fix update/insert with timestamp columns
  • Loading branch information
NathanW2 committed Apr 12, 2017
1 parent 49e1ae4 commit 6726214fd8f548255b978349b0195e29d3a0051f
Showing with 12 additions and 0 deletions.
  1. +12 −0 src/providers/mssql/qgsmssqlprovider.cpp
@@ -823,6 +823,9 @@ bool QgsMssqlProvider::addFeatures( QgsFeatureList &flist )

QgsField fld = mAttributeFields.at( i );

if ( fld.typeName().toLower() == QLatin1String( "timestamp" ) )
continue; // You can't update timestamp columns they are server only.

if ( fld.typeName().endsWith( QLatin1String( " identity" ), Qt::CaseInsensitive ) )
continue; // skip identity field

@@ -897,6 +900,9 @@ bool QgsMssqlProvider::addFeatures( QgsFeatureList &flist )

QgsField fld = mAttributeFields.at( i );

if ( fld.typeName().toLower() == QLatin1String( "timestamp" ) )
continue; // You can't update timestamp columns they are server only.

if ( fld.typeName().endsWith( QLatin1String( " identity" ), Qt::CaseInsensitive ) )
continue; // skip identity field

@@ -1127,6 +1133,9 @@ bool QgsMssqlProvider::changeAttributeValues( const QgsChangedAttributesMap &att
{
QgsField fld = mAttributeFields.at( it2.key() );

if ( fld.typeName().toLower() == QLatin1String( "timestamp" ) )
continue; // You can't update timestamp columns they are server only.

if ( fld.typeName().endsWith( QLatin1String( " identity" ), Qt::CaseInsensitive ) )
continue; // skip identity field

@@ -1158,6 +1167,9 @@ bool QgsMssqlProvider::changeAttributeValues( const QgsChangedAttributesMap &att
{
QgsField fld = mAttributeFields.at( it2.key() );

if ( fld.typeName().toLower() == QLatin1String( "timestamp" ) )
continue; // You can't update timestamp columns they are server only.

if ( fld.typeName().endsWith( QLatin1String( " identity" ), Qt::CaseInsensitive ) )
continue; // skip identity field

0 comments on commit 6726214

Please sign in to comment.