sql-serversql-server-2016sql-graph

Create a graph table in SQL Server 2016


I am trying to create a simple node table, using:

CREATE TABLE Person (ID INTEGER PRIMARY KEY, name VARCHAR(100)) AS NODE

But whatever I try I get an error:

Incorrect syntax near the keyword 'as'. as if it doesn't understand the 'As Node' part.

I am using SQL Server 13.0.1601.
Database compatibility: SQL Server level 2016(130)
SSMS: v17.2
@@version: "Microsoft SQL Server 2016 (RTM) - 13.0.1601.5 (X64) Apr 29 2016 23:23:58 Copyright (c) Microsoft Corporation Express Edition (64-bit) on Windows 10 Pro 6.3 (Build 14393: ) (Hypervisor)"


Solution

  • You can't do CREATE TABLE (SQL Graph) in earlier versions of SQL Server, because it applies to SQL Server 2017.

    See the documentation.

    Enter image description here