diff --git a/core/org.wso2.carbon.user.core/src/main/java/org/wso2/carbon/user/core/tenant/JDBCTenantManager.java b/core/org.wso2.carbon.user.core/src/main/java/org/wso2/carbon/user/core/tenant/JDBCTenantManager.java index 1e4bcdd931f..2bf436da1dc 100644 --- a/core/org.wso2.carbon.user.core/src/main/java/org/wso2/carbon/user/core/tenant/JDBCTenantManager.java +++ b/core/org.wso2.carbon.user.core/src/main/java/org/wso2/carbon/user/core/tenant/JDBCTenantManager.java @@ -1171,6 +1171,12 @@ private ResultSet getTenantQueryResultSet(Connection dbConnection, String sorted prepStmt = dbConnection.prepareStatement(sqlQuery); prepStmt.setInt(1, offset); prepStmt.setInt(2, limit); + } else if (dbType.equalsIgnoreCase("Microsoft SQL Server")) { + sqlTail = String.format(TenantConstants.LIST_TENANTS_MSSQL_TAIL, sortedOrder); + sqlQuery = sqlQuery + sqlTail; + prepStmt = dbConnection.prepareStatement(sqlQuery); + prepStmt.setInt(1, offset); + prepStmt.setInt(2, limit); } else if (dbType.equalsIgnoreCase("db2")) { sqlQuery = TenantConstants.LIST_TENANTS_PAGINATED_DB2; sqlTail = String.format(TenantConstants.LIST_TENANTS_DB2_TAIL, sortedOrder);