Skip to content
Permalink
Browse files

[MSSQL] Fix string length when using nchar, nvarchar, ntext

  • Loading branch information
NathanW2 committed Jul 5, 2017
1 parent 70d2ae2 commit 1c273f815dfd0310fd27ddb1855875a695f04922
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/providers/mssql/qgsmssqlprovider.cpp
@@ -418,11 +418,16 @@ void QgsMssqlProvider::loadFields()
}
if ( sqlType == QVariant::String )
{
int length = query.value( 7 ).toInt();
if ( sqlTypeName.startsWith( "n" ) )
{
length = length / 2;
}
mAttributeFields.append(
QgsField(
query.value( 3 ).toString(), sqlType,
sqlTypeName,
query.value( 7 ).toInt() ) );
length ) );
}
else if ( sqlType == QVariant::Double )
{

0 comments on commit 1c273f8

Please sign in to comment.
You can’t perform that action at this time.