From the course: SQL Server 2017: What's New

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Defining nodes and edges

Defining nodes and edges - SQL Server Tutorial

From the course: SQL Server 2017: What's New

Start my 1-month free trial

Defining nodes and edges

- [Man] Support for graph databases in SQL Server 2017 makes use of the same table structures that you're already used to using. Nodes and edges in the graph are simply stored in node tables and edge tables. And since they use the same tables as relational databases, all the Transact-SQL operations that apply to tables can still be used. The only difference that you need to keep in mind is to use the As Edge or As Node keywords at the end of your create table statements. Let's take a look by creating a new database, called GraphTest. Then I'll search my context into GraphTest. I'll highlight that line and execute it. And then we'll create a new table inside that database called People. This table will have a column for the ID, it'll be an integer data type and it'll be the primary key for the table. Then we'll have a column for name, it'll be a varchar 100 data type. And finally a column for age, which will sort as an integer. Now before I finish the create table statement, I'm going…

Contents