Skip to Main Content
SQL Server 2017 Developer???s Guide
book

SQL Server 2017 Developer???s Guide

by Dejan Sarka, Miloš Radivojević, William Durkin
March 2018
Intermediate to advanced content levelIntermediate to advanced
816 pages
19h 35m
English
Packt Publishing
Content preview from SQL Server 2017 Developer???s Guide

Node tables

A node table represents an entity in a graph schema. It must have properties (at least one column). All you need is to finish your CREATE TABLE statement with the AS NODE extension to indicate that the table represents a graph node. The following statements create and populate a node table in SQL Server 2017:

CREATE TABLE dbo.TwitterUser(UserId BIGINT NOT NULL,UserName NVARCHAR(100) NOT NULL) AS NODEGOINSERT INTO dbo.TwitterUser VALUES(1, '@MilosSQL'),(2, '@DejanSarka'),(3, '@sql_williamd'),(4, '@tomaz_tsql'),(5, '@WienerSportklub'),(6, '@nkolimpija');

With the exception of the AS NODE extension, this code is a typical Transact-SQL code, and you did not enter any graph attributes. However, when you look at the table content, you'll ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

SQL Server 2016 Developer's Guide

SQL Server 2016 Developer's Guide

Miloš Radivojević, Dejan Sarka, William Durkin
Mastering SQL Server 2017

Mastering SQL Server 2017

Milos Radivojevic, Dejan Sarka, William Durkin, Christian Cote, Matija Lah

Publisher Resources

ISBN: 9781788476195Supplemental Content