By Rudderstack Team

How to load data from BaseCRM to MS SQL Server

This post helps you with loading your data from Base CRM to MS SQL Server. If you are looking to get analytics-ready data without the manual hassle you can integrate Base CRM to MS SQL Server with RudderStack, so you can focus on what matters, getting value out of your customers’ analysis data.

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:

  1. Account: The Account API gives read-only access to your account details.
  2. Calls: The Calls API provides a convenient interface to manage calls.
  3. Contacts: The Contacts API provides a simple interface to manage your contacts. A contact represents an individual or an organization.
  4. Deals: The Deals API gives a convenient interface to manage deals.
  5. 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.
  6. Orders: Through the Orders API you can manage your orders.
  7. Pipelines: The Pipelines API gives a read-only interface to your sales pipeline definition.
  8. Products: The Products API offers an interface for managing the Product Catalog. The catalog lists products that are available in your account.
  9. 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:

  1. Rate limits. According to the documentation, you can make up to 36,000 requests per hour (10 requests/IP/second).
  2. Authentication. You can authenticate on Base CRM using OAuth.
  3. 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.

About Base CRM

Base CRM, is a web-based next-generation customer relationship management (CRM) platform that offers customer management, sales tracker, sales pipeline monitoring, email tracking, forecasting, reporting, and many more. Founded in 2009, Base CRM offers to sales teams the necessary tools to consolidate workflows, increase their efficiency and overall performance and scale easily.

Base CRM currently offers three different APIs for programmatically interact with the platform: Core, Sync, and Firehose. Base’s Sync API is suitable for syncing the latest Base data while Firehose for receiving near real-time stream of changes in Base data. However, both Sync and Firehose are available only for certain upgraded plans.

On the other hand, the Core API is very convenient for creating, reading, updating, and deleting Base data RESTfully and is also available for all subscription plans.

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,

  1. The limitations of the database that the data will be loaded onto
  2. 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