@@ -810,7 +810,10 @@ bool QgsMssqlProvider::addFeatures( QgsFeatureList & flist )
810
810
{
811
811
QgsField fld = mAttributeFields .at ( i );
812
812
813
- if ( fld.typeName ().endsWith ( " identity" , Qt::CaseInsensitive ) )
813
+ if ( fld.typeName ().toLower () == QLatin1String ( " timestamp" ) )
814
+ continue ; // You can't update timestamp columns they are server only.
815
+
816
+ if ( fld.typeName ().endsWith ( QLatin1String ( " identity" ), Qt::CaseInsensitive ) )
814
817
continue ; // skip identity field
815
818
816
819
if ( fld.name ().isEmpty () )
@@ -881,7 +884,10 @@ bool QgsMssqlProvider::addFeatures( QgsFeatureList & flist )
881
884
{
882
885
QgsField fld = mAttributeFields .at ( i );
883
886
884
- if ( fld.typeName ().endsWith ( " identity" , Qt::CaseInsensitive ) )
887
+ if ( fld.typeName ().toLower () == QLatin1String ( " timestamp" ) )
888
+ continue ; // You can't update timestamp columns they are server only.
889
+
890
+ if ( fld.typeName ().endsWith ( QLatin1String ( " identity" ), Qt::CaseInsensitive ) )
885
891
continue ; // skip identity field
886
892
887
893
if ( fld.name ().isEmpty () )
@@ -1111,7 +1117,10 @@ bool QgsMssqlProvider::changeAttributeValues( const QgsChangedAttributesMap &att
1111
1117
{
1112
1118
QgsField fld = mAttributeFields .at ( it2.key () );
1113
1119
1114
- if ( fld.typeName ().endsWith ( " identity" , Qt::CaseInsensitive ) )
1120
+ if ( fld.typeName ().toLower () == QLatin1String ( " timestamp" ) )
1121
+ continue ; // You can't update timestamp columns they are server only.
1122
+
1123
+ if ( fld.typeName ().endsWith ( QLatin1String ( " identity" ), Qt::CaseInsensitive ) )
1115
1124
continue ; // skip identity field
1116
1125
1117
1126
if ( fld.name ().isEmpty () )
@@ -1142,7 +1151,10 @@ bool QgsMssqlProvider::changeAttributeValues( const QgsChangedAttributesMap &att
1142
1151
{
1143
1152
QgsField fld = mAttributeFields .at ( it2.key () );
1144
1153
1145
- if ( fld.typeName ().endsWith ( " identity" , Qt::CaseInsensitive ) )
1154
+ if ( fld.typeName ().toLower () == QLatin1String ( " timestamp" ) )
1155
+ continue ; // You can't update timestamp columns they are server only.
1156
+
1157
+ if ( fld.typeName ().endsWith ( QLatin1String ( " identity" ), Qt::CaseInsensitive ) )
1146
1158
continue ; // skip identity field
1147
1159
1148
1160
if ( fld.name ().isEmpty () )
0 commit comments