How to load data from BaseCRM to MS SQL Server
Access your data on Base CRM
The first step in loading your data from Base CRM to any kind of data warehouse solution is to access your data and start extracting it.
As previously mentioned, using Base’s rich Core API you can get access to data from 25 resources including, among others, the following:
- Account: The Account API gives read-only access to your account details.
- Calls: The Calls API provides a convenient interface to manage calls.
- Contacts: The Contacts API provides a simple interface to manage your contacts. A contact represents an individual or an organization.
- Deals: The Deals API gives a convenient interface to manage deals.
- Leads: The Leads API provides a simple interface to manage leads. A lead represents an individual or an organization that expresses interest in your goods or services.
- Orders: Through the Orders API you can manage your orders.
- Pipelines: The Pipelines API gives a read-only interface to your sales pipeline definition.
- Products: The Products API offers an interface for managing the Product Catalog. The catalog lists products that are available in your account.
- Users: Using the User’s API you can interact with your account’s users. You can retrieve a single user as well as a list of all users associated with your account.
In addition to the above, the things that you have to keep in mind when dealing with the Base CRM API, are:
- Rate limits. According to the documentation, you can make up to 36,000 requests per hour (10 requests/IP/second).
- Authentication. You can authenticate on Base CRM using OAuth.
- Pagination. API endpoints that return a collection of items are always paginated. The number of results to display can vary with a maximum value of 100.
Transform and prepare Base CRM data for MS SQL Server
After you have accessed any data from Base CRM, you will have to transform it based on two main factors,
- The limitations of the database that the data will be loaded onto
- The type of analysis that you plan 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.
Also, you have to choose the right data types. Again, depending on the system that you will send the data to and the data types that the API exposes to you, you will have to make the right choices. These choices are important because they can limit the expressivity of your queries and limit your analysts on what they can do directly out of the database.
Also, you have to consider that the reports you’ll get from Base CRM are like CSV files in terms of their structure and you need to somehow identify what and how to map to a table into your database.
Load Base CRM data into Microsoft SQL Server
So, after you have managed to access your data on BaseCRM and you have also figured out the structure that the data will have on your database, you need to load the data 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 into a database. One way of importing data into your database is by using the SQL Server Import and Export Wizard. With it and through a visual interface you will be able to bulk load data from a number of data sources that are supported.
Another way for importing bulk data into an SQL Server, both on Azure and on-premises, is by using the bcp utility. This is a command-line tool that is built specifically for bulk loading and unloading of data from an MS SQL database.
Finally and for compatibility reasons, especially if you are managing databases from different vendors, you can BULK INSERT SQL statements.
In a similar way and as it happens with the rest of the 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 into a table but it doesn’t scale very well with larger datasets.
Updating your Base CRM data on MS SQL Server
As you will be generating more data on Base CRM, 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 Base CRM.
You will need to periodically check Base CRM for new data and repeat the process that has been described previously while updating your currently available data if needed. 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 the identification and removal of any duplicate records on your database. Either because Base CRM does not have a mechanism to identify new and updated records or because of errors on your data pipelines, duplicate records might be introduced to your database.
In general, ensuring the quality of the data that is inserted in your database is a big and difficult issue and MS SQL Server features like TRANSACTIONS can help tremendously, although they do not solve the problem in the general case.
The best way to load data from Base CRM to MS SQL Server
So far we just scraped the surface of what you can do with MS SQL Server and how to load data into it. Things can get even more complicated if you want to integrate data coming from different sources.
Are you striving to achieve results right now?
Instead of writing, hosting, and maintaining a flexible data infrastructure use RudderStack that can handle everything automatically for you.
RudderStack with one click integrates with sources or services, creates analytics-ready data, and syncs your Base CRM to MS SQL Server right away.