We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
qgis
Learn more about funding links in repositories.
Report abuse
There was an error while loading. Please reload this page.
1 parent 22debea commit 1b663bbCopy full SHA for 1b663bb
src/providers/mssql/qgsmssqlprovider.cpp
@@ -854,6 +854,26 @@ bool QgsMssqlProvider::addFeatures( QgsFeatureList & flist )
854
return false;
855
}
856
857
+
858
859
+ if ( mSchemaName.isEmpty() )
860
+ statement = QString( "SELECT IDENT_CURRENT('dbo.%1')" ).arg( mTableName );
861
+ else
862
+ statement = QString( "SELECT IDENT_CURRENT('%1.%2')" ).arg( mSchemaName, mTableName );
863
864
+ if ( !query.exec( statement ) )
865
+ {
866
+ QString msg = query.lastError().text();
867
+ QgsDebugMsg( msg );
868
+ if ( !mSkipFailures )
869
870
+ pushError( msg );
871
+ return false;
872
+ }
873
874
875
+ query.next();
876
+ it->setFeatureId( query.value( 0 ).toLongLong() );
877
878
879
return true;
0 commit comments