Knowledgebase
[QODBC-Desktop] How to Insert Multiple Records into TimeTracking Table
Posted by Rajendra Dewani (QODBC Support) on 14 April 2014 03:32 PM

Instruction:

When inserting multiple records into a line item table, you can use column FQSaveToCache.

Set column FQSaveToCache to 1 in all insert queries except the last line set to 0. But table TimeTracking is not a line item table; there is no FQSaveToCache column in that table.

So you need to use the alternate method. This article will show you how to use the sp_batch command to insert multiple records into TimeTracking.

If you are unfamiliar with the sp_batch statement, please refer to This article for more information.

First, please run the following:

SP_BATCHCLEAR Time tracking

This command will remove all cached data from the TimeTracking table. It will make sure only the queries below will be executed.

 


Note: 
 QODBC Support Wizard is used only to test QODBC SQL queries and is not a development tool.

 

Then run this query to start the batch:

SP_BATCHSTART Time tracking

When this query is executed, all queries later will be stored in the cache instead of directly sending to QuickBooks

Then run your insert queries. Here we use our test company file as an example:

INSERT INTO TimeTracking (EntityRefListID, DurationMinutes, TxnDate, CustomerRefFullName, ItemServiceRefFullName, PayrollItemWageRefFullName) Values ('60001-1039046236',540, {d'2022-01-06'},‘' KimGarland'’, 'Installation Labor,' 'Sick -Salary')

INSERT INTO TimeTracking (EntityRefListID, DurationMinutes, TxnDate, CustomerRefFullName, ItemServiceRefFullName, PayrollItemWageRefFullName) Values ('F0002-1039046343',600, {d'2022-01-06'}, ‘'WestTest'’, 'Installation Labor,' 'Sick -Salary')

After all insert queries are executed, upload all cached queries to QuickBooks using this command:

SP_BATCHUPDATE Time tracking

This query will upload all queries in the cache to QuickBooks.

(1 vote(s))
Helpful
Not helpful

Comments (2)
Bev Kaufman
17 December 2014 07:35 PM
I don't see that this solves my problem. I'm going to have a load of insert queries to run. If I could do this in MS Sql, which is installed on a different server, I would passed all the commands into one query window and hit run. Using VB Demo, the only tool available to me now, I will have to paste each line one at a time and run it. Is there an easier way to do this?
Jack
18 December 2014 08:26 AM
Hi Bev,

I would like to inform you that VB Demo is just an application to test your queries or connection. It is the default behavior of VB Demo you can execute only one command at a time. You can use other ODBC application like MS Access or can write VBA code. Please refer below mentioned article for sample VBA code:
http://support.flexquarters.com/esupport/index.php?/Knowledgebase/Article/View/2571/0/using-quickbooks-data-with-vba
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please complete the captcha below (we use this to prevent automated submissions).