How to load data from NetSuite to MS SQL Server

Access your data on NetSuite

The first step in loading your NetSuite data to any data warehouse solution is accessing them and starting extracting them.

NetSuite’s data model comes into to three following versions:

1. SuiteScript Model: Suitable if working with Script or the Workflow Tool.

2. Web Service Model: Suitable when external applications need to connect to NetSuite.

3. ODBC/JDBC Model: Available when SuiteAnalytics module is purchased. This allows you to connect to a read-only version of NetSuite using ODBC or JDBC drivers.

Although differences do exist among the models mentioned above, the main types of information are always present and, among others, include the following:

1. Accounts

2. Transactions

3. Campaigns

4. Revenue Recognition

When working with the SuiteScript Model, you can extend the SuiteScript API using RESTlets.This way, you can deploy server-side scripts that interact with NetSuite data following RESTful principles. RESTlets offer ease of adoption for developers familiar with SuiteScript and support more behaviors than NetSuite’s SOAP-based web services, which are limited to those defines as SuiteTalk operations.

On the other hand, if you choose the Web Service model you will have to work with NetSuite’s web services API, which is implemented using the SOAP protocol, adding some complexity to your development as you will have to manage SOAP and XML responses.

Also, keep in mind that you will have to respect the API usage limits as in every other API and make sure that you handle errors correctly.

Transform and prepare your NetSuite data for MS SQL Server

After you have accessed data on NetSuite, you will have to transform it based on two main factors,

1. The limitations of the database that will be used

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. Keep in mind that you will get XML responses if you are working with the web services SOAP API. Of course, when dealing with tabular data stores, like Microsoft SQL Server, this is not an option. Instead, you will have to flatten out all data, just as in the case of JSON, before loading it into the database.

Of course, when dealing with tabular data stores, like Microsoft SQL Server, this is not an option. Instead, you will have to flatten out any data, just as in the case of JSON, before loading it into the database.

Also, you have to choose suitable data types. Again, depending on the system you will send the data and the data types that the API exposes to you, you will have to make the right choices. These choices are essential because they can limit your queries’ expressivity and limit your analysts on what they can do directly out of the database.

With the NetSuite web services API, you also have two primary additional sources of complexity. When it comes to data types you have to keep in mind that SOAP is using XML to describe the service and the data, so every data types that you have to map are coming from XML and might have automatically be transformed into the primitive data types of the language you use.

Load your NetSuite data into Microsoft SQL Server

After you have managed to access data on NetSuite and have also figured out the structure that 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 to 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 several supported data sources.

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 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 are managing databases from different vendors.

Similarly, 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 in a table, but it doesn’t scale very well with larger datasets.

Updating your NetSuite data on MS SQL Server

As you will be generating more data on NetSuite, 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 NetSuite.

You will need to periodically check NetSuite for new data and repeat the process described previously while updating your currently available data if required. 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. Either because NetSuite 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 data inserted in your database is a significant and challenging issue, and MS SQL Server features like TRANSACTIONS can help tremendously. However, they do not solve the problem in the general case.

The best way to load data from NetSuite 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 various 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 NetSuite to MS SQL Server right away.

Sign Up For Free And Start Sending Data

Test out our event stream, ELT, and reverse-ETL pipelines. Use our HTTP source to send data in less than 5 minutes, or install one of our 12 SDKs in your website or app.

Don't want to go through the pain of direct integration? RudderStack's NetSuite integration makes it easy to send data from NetSuite to MS SQL Server.