Skip to content

Commit

Permalink
Merge pull request #445 from szekerest/master
Browse files Browse the repository at this point in the history
MSSQL: Fix for the problem with the length of the numeric fields (Fix #7249)
  • Loading branch information
NathanW2 committed Feb 27, 2013
2 parents 84db88b + f5d81ae commit b5dc778
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions src/providers/mssql/qgsmssqlprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,12 +370,21 @@ void QgsMssqlProvider::loadFields()
{
pkCandidates << query.value( 3 ).toString();
}
mAttributeFields.append(
QgsField(
query.value( 3 ).toString(), sqlType,
sqlTypeName,
query.value( 7 ).toInt(),
query.value( 6 ).toInt() ) );
if ( sqlType == QVariant::String )
{
mAttributeFields.append(
QgsField(
query.value( 3 ).toString(), sqlType,
sqlTypeName,
query.value( 7 ).toInt() ) );
}
else
{
mAttributeFields.append(
QgsField(
query.value( 3 ).toString(), sqlType,
sqlTypeName ) );
}

if ( !query.value( 12 ).isNull() )
{
Expand Down

0 comments on commit b5dc778

Please sign in to comment.