Skip to content

Commit ff7a47d

Browse files
committed
[MSSQL] Use schema name when getting columns
1 parent f283040 commit ff7a47d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/providers/mssql/qgsmssqlprovider.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ void QgsMssqlProvider::loadFields()
353353
// get field spec
354354
QSqlQuery query = QSqlQuery( mDatabase );
355355
query.setForwardOnly( true );
356-
if ( !query.exec( QString( "exec sp_columns N'%1', NULL, NULL, NULL, NULL" ).arg( mTableName ) ) )
356+
if ( !query.exec( QString( "exec sp_columns @table_name = N'%1', @table_owner = '%2'" ).arg( mTableName, mSchemaName ) ) )
357357
{
358358
QString msg = query.lastError().text();
359359
QgsDebugMsg( msg );

0 commit comments

Comments
 (0)