How to load data from QuickBooks to MS SQL Server
Access your data on QuickBooks
The first step in loading your QuickBooks data into any data warehouse solution is accessing and extracting it through the available web API.
QuickBooks has a very rich and well-defined API, reflecting the extensive development that the product has gone through. The API is designed around the following main groups of resources:
- Transaction resources
- Name list resources
- Report resources
- Supporting resources
Report resources contain all the reports that QuickBooks also offer from within the application. They have a different data model than the rest of the resources, and you need to account for these differences when extracting data from the API.
The rest of the resources contain pretty much every possible entity that QuickBooks define, each with a different data model serialized in JSON. Also, keep the following things in mind when dealing with the QuickBooks API:
- Rate limits: Every API has some rate limits that you have to respect.
- Authentication: You authenticate on QuickBooks using an API key.
- Paging and dealing with large amounts of data: Platforms like QuickBooks tend to generate lots of data, as financial transactions and accounting involve many different events. Pulling big volumes of data out of an API might be difficult, especially when considering any rate limits that the API has.
QuickBooks is an accounting software released and maintained by Intuit. It currently has two versions - desktop and cloud-based. This guide is about the latter, where you can access the data through the REST API that Intuit has built around the product.
QuickBooks is mainly used by small and medium-sized companies and covers the whole spectrum of a company's accounting-related activities, from payroll to the management and payment of bills.
Historically, QuickBooks is one of the first accounting software that was ever released. Its initial release was for the DOS operating system, and it managed to dominate the small and medium-sized companies market for many years.
Transform and prepare your QuickBooks data for MS SQL Server
After you have accessed your data on QuickBooks, you will have to transform it based on two main factors:
- The limitations of the database that is going to be used
- The type of analysis that you want to perform
Each system has specific limitations on the data types and data structures that it supports. If, for example, you want to push data into Google BigQuery, then you can send nested data like JSON directly. But when dealing with tabular data stores like Microsoft SQL Server, this is not an option. Instead, you will have to flatten out your data before loading it into the database.
Another consideration is that you have to choose the right data types. Again, depending on the system you will send the data to and the data types that the API exposes, you will have to make the right choices. These choices are important because they can limit your queries' expressivity and limit your analysts on what they can do directly out of the database.
QuickBooks has a very rich data model, where many of the resources you can access might have to be flattened out and be pushed in more than one table.
QuickBooks has a special set of resources - the reports - that have a tabular but nested format that looks similar to a complex spreadsheet. To make these reports compatible with a database data model, you need to redesign, parse and transform the reports into a tabular form that you can store in a database.
Load your Quickbooks data into Microsoft SQL Server
After you have managed to access your data on Quickbooks and have also figured out the structure that data will have on your database, you need to load them into the database, in our case, into a Microsoft SQL Server.
As a feature-rich and mature product, MS SQL Server offers a large and diverse set of methods for loading data to a database. One way of importing data into your database is by using the SQL Server Import and Export Wizard. With its visual interface, you will be able to bulk load data from several supported data sources.
Another way for importing bulk data to an SQL Server, both on Azure and on-premises, is by using the BCP utility. This is a command-line tool built specifically for bulk loading and unloading of data from an MS SQL database.
Finally, you can BULK INSERT SQL statements for compatibility reasons, especially if you manage databases from different vendors.
Similarly, and as in other databases, you can also use the standard INSERT statements, where you will be adding data row-by-row directly to a table. It is the most basic and straightforward way of adding data in a table, but it doesn't scale very well with larger datasets.
Updating your Quickbooks data on MS SQL Server
As you will be generating more data on Quickbooks, you will need to update your older data on an MS SQL Server database. This includes new records, together with updates to older records that for any reason have been updated on Quickbooks.
You will need to periodically check Quickbooks for new data and repeat the process that has been described before while updating your currently available data. Updating an already existing row on a SQL Server table is achieved by creating UPDATE statements.
Another issue that you need to take care of is identifying and removing any duplicate records on your database. Quickbooks does not have a mechanism to identify new and updated records. Also, errors in your data pipelines can introduce duplicate records in your database.
In general, ensuring the quality of data inserted in your database is a big issue. MS SQL Server features like TRANSACTIONS can help tremendously, although they do not solve the general case problem.
The best way to load data from QuickBooks to MS SQL Server
In this post, we just scraped the surface of what you can do with MS SQL Server and how to load data into it. However, things can get even more complicated if you want to integrate data coming from different sources.
Instead of writing, hosting, and maintaining a flexible data infrastructure, RudderStack can handle everything automatically for you. With one click, RudderStack integrates with sources or services, creates analytics-ready data, and syncs your QuickBooks to MS SQL Server right away.
You can now use RudderStack to help your accounting and executive team take ownership of the data that lives inside Quickbooks to consolidate your accounting data better.
Don't want to go through the pain of direct integration? RudderStack's QuickBooks integration makes it easy to send data from QuickBooks to MS SQL Server.