Neo4j & SSIS – Connecting and executing Cypher in a Control Flow
Tags: neo4j, ssis
Published: 2020-02-19 09:33:15

---
title: Neo4j & SSIS – Connecting and executing Cypher in a Control Flow
published: true
date: 2019-07-18 16:30:51 UTC
tags: Neo4j,SSIS
canonical_url: 
---

Last Friday, Anabranch released the first beta version of it’s connector to Neo4j from SSIS. Aside from a post saying that it existed, I didn’t go into detail, so this is going to be a series of posts on how you can use your existing SSIS infrastructure with Neo4j.

Today we’re going to look at 2 parts of the connector, the Neo4j Connection Manager (CM) and the Execute Cypher Task (ECT). The CM is fundamental to all the controls, without it, you can’t connect to the database. I’ll go into what it does, settings etc in another post, but for now – it’s enough to know that it provides the connection. The ECT allows us to execute Cypher against a given connection manager.

\*\* NOTE \*\*  
**In version 1.0.0(beta) – the ECT will only work with the _first_ CM you add to the package**

This video covers the same topic as the text version below:

<iframe src="https://player.vimeo.com/video/348801227" width="525" height="295" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>

I’m going to develop this in Visual Studio 2017, at the time of writing – I found the 2019 SSIS packages to be a bit flakey, whereas the 2017 has been sturdy so far – from a ‘demo’ point of view though – the 2019 process is exactly the same after you have it all installed.

**SETUP**  
 If you’ve never developed against SSIS before, you’ll need a couple of things, firstly SSDT (specifically the Integration services bits), Visual Studio – I think the community edition should work, but I can’t confirm. You’ll also need the Anabranch Ssis Controls for Neo4j – assuming you’ve registered ( http://anabranch.co.uk/Projects/Neo4jSsis) and have the download link, you’ll want the **2017 x86** version of the controls – (for VS2019 as well!).

Download and install the controls. NB. You want to install these when Visual Studio _isn’t_ running – as we’re in the heady world of the GAC here, and VS won’t find them unless it’s started with them there.

Do do this example yourself – you’ll also need a Neo4j database instance running, I’d recommend using the [Neo4j Desktop](https://neo4j.com/download/) as it makes it easier to manage the process.

### Create your first package

1. Start up Visual Studio  
2. Create a new Integration Services project

![](https://xclave.co.uk/wp-content/uploads/2019/07/image-3.png)<figcaption>New Project…</figcaption>

![](https://xclave.co.uk/wp-content/uploads/2019/07/image-4-1024x724.png)

3. In the new _Package.dtsx_ file, we need to add a Connection Manager. Right click on the bottom ‘Connection Managers’ bar and add a Neo4j connection – if you don’t see it – you might have to restart Visual Studio, or possibly your machine.

![](https://xclave.co.uk/wp-content/uploads/2019/07/image-5-1024x703.png)

Then select the Neo4j Connection:

![](https://xclave.co.uk/wp-content/uploads/2019/07/image-6.png)

You’ll now see it in the ‘Connection Managers’ section:

![](https://xclave.co.uk/wp-content/uploads/2019/07/image-7.png)

Select it – and change the connection properties to ones that match your database instance – at the moment this is done via the properties window:

![](https://xclave.co.uk/wp-content/uploads/2019/07/image-8.png)

At this stage, we have a connection – but we’re not using it, so let’s add a task to execute:

![](https://xclave.co.uk/wp-content/uploads/2019/07/image-9.png)

Drag the ‘Execute Cypher Task’ to the Control Flow, and double click on it. Then add the following Cypher:

```
CREATE (:Node {Id:1})
```

![](https://xclave.co.uk/wp-content/uploads/2019/07/image-10.png)

Press **OK**

Then we can execute the task:

![](https://xclave.co.uk/wp-content/uploads/2019/07/image-11.png)

Once that’s done:

![](https://xclave.co.uk/wp-content/uploads/2019/07/image-12.png)

If we go to our Neo4j Database, we can run:

```
MATCH (n:Node) RETURN n
```

If we look at the ‘Id’ property – we can see it is ‘1’

![](https://xclave.co.uk/wp-content/uploads/2019/07/image-13.png)

So. Now we have an SSIS integration package executing against a Neo4j database.

These controls are currently in an open beta, to register to get the controls, please go to: http://bit.ly/neo4jssis