Knowledgebase
[QODBC-Online] - Optimizer Full Sync: Running Multiple sp_optimizefullsync Queries Together Does Not Work
Posted by William - QODBC Support on 13 October 2026 12:18 PM

[QODBC-Online] - Optimizer Full Sync: Running Multiple sp_optimizefullsync Queries Together Does Not Work

Problem Description:

When attempting to rebuild or sync the QODBC Online Optimizer for multiple tables, running several sp_optimizefullsync queries one after another in the QODBC Online Test Tool does not work as expected. For example, running:

 sp_optimizefullsync Account
 sp_optimizefullsync Customer
 sp_optimizefullsync InvoiceLine

in sequence will not successfully optimize all three tables. Only the first query takes effect; subsequent queries are ignored or hang.

Affected products: QODBC Online
Expected outcome: After using the correct approach (sp_optimizefullsync All or one table at a time), all optimizer tables sync correctly.

Symptoms:

  • Running multiple sp_optimizefullsync queries in succession - one per table - does not update all tables.
  • The QODBC Online Test Tool may appear to hang or stall during the process (e.g., stuck for hours on a single table like ExchangeRate).
  • After reinstallation and running sp_optimizefullsync All data appears correct, but subsequent individual queries fail.
  • The issue was observed when trying to optimize tables one-by-one instead of using the built-in "All" option.

Cause:

The QODBC Online Optimizer does not support running multiple individual sp_optimizefullsync <TableName> queries in succession through the same session. The Optimizer is designed to handle either one full sync command (sp_optimizefullsync All) or a single table sync at a time - not multiple individual table syncs chained together.

Additionally, certain tables (such as ExchangeRate)

Environment:

ProductVersion / Detail
QODBC Online All versions
QuickBooks Online All editions
Data Source Tools QODBC Online Test Tool (32-bit and 64-bit), MS Excel, MS Access

Solution:

Method 1: Use sp_optimizefullsync All (Recommended)

To rebuild the entire optimizer cache for all tables at once, run a single command:

 sp_optimizefullsync  All
  1. Open the QODBC Online Test Tool (32-bit).
  2. Execute sp_optimizefullsync All.
  3. Wait for all tables to sync. This may take significant time depending on your company file size.

Method 2: Optimize One Table at a Time (Standalone)

If you need to optimize only specific tables, run exactly one sp_optimizefullsync command per session - do not chain multiple queries:

 sp_optimizefullsync  Account

Close the Test Tool, reopen it, and run the next table sync in a new session:

 sp_optimizefullsync  Customer

Method 3: Reauthorize Company File and Rename Optimizer File (For Stalled Processes)

  1. Reauthorize the company file:
    • Start → All Apps → QODBC Driver for QuickBooks Online → Configure 32-Bit QODBC Online Driver
    • System DSN → Your DSN → General tab → Click "Disconnect from QuickBooks"
    • Click "Connect to QuickBooks" and re-authorize.
  2. Rename the optimizer file: Navigate to %AppData%\QODBC Driver for QuickBooks Online\Optimizer and rename (or delete) the existing optimizer files.
  3. Optimize a single table first: Open the QODBC Online Test Tool and run SELECT * FROM ExchangeRate or your target table. If it completes, then run sp_optimizefullsync All.

Method 4: Query Inactive Products/Services via QODBC Online

By default, the QuickBooks Online API returns only active items (those with IsActive = true). To retrieve inactive products and services:

SELECT * FROM ItemService WHERE IsActive = 0

Replace ItemService with ItemGroup if querying the group-item table:

SELECT * FROM ItemGroup WHERE IsActive = 0

Example Scenarios:

Before the fix:

A user ran individual optimize commands for five tables in sequence (Account, Customer, DepositLine, Entity, InvoiceLine). None of them took effect properly, and the process appeared to hang on ExchangeRate for over 153 hours.

After the fix:

The user reauthorized the company file, renamed the optimizer files, ran SELECT * FROM ExchangeRate individually (which completed), then executed sp_optimizefullsync All in a single session. All tables synced successfully.

Additional Notes:

  • Optimization duration varies by table: Tables with large data volumes (e.g., ExchangeRate, InvoiceLine) may take several hours to days to sync depending on the QuickBooks Online company file size.
  • Do not kill a running optimize process prematurely: Aborting the process may corrupt the optimizer, requiring you to start over.
  • For troubleshooting missing data: Use UNOPTIMIZED queries to verify whether data exists in QuickBooks Online independently of the optimizer. See Troubleshooting Missing Records in QODBC Online.
  • If data appears after a date range is missing: Run sp_optimizeupdatesync <TableName> to update only the specific table's cache instead of a full rebuild.

Understanding QODBC Optimizer How to Rebuild the QODBC Optimizer Using UNOPTIMIZED Queries in QODBC Online Troubleshooting Missing Records in QODBC Online

Keywords:

sp_optimizefullsync Optimizer Sync Multiple Queries QODBC Online ExchangeRate Stalled Process Inactive Items IsActive ItemService Company File Reauthorization Optimizer Rebuild QuickBooks Online API
(0 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please complete the captcha below (we use this to prevent automated submissions).