Questions tagged [sql-server-2017-graph]

Questions about Graph processing with SQL Server

introduces into . See https://learn.microsoft.com/en-us/sql/relational-databases/graphs.

It allows creating Node and Edge tables. Edge tables represent edges in a or relationships. Edge tables are an alternative for the intermediate tables that relational databases require to store n-to-n relationships. Edge tables connect to Node tables. Nodes represent an entity.

The MATCH keyword allows easy traversing the relationships; e.g.:

SELECT Person2.name AS FriendName
FROM Person Person1, friend, Person Person2
WHERE MATCH(Person1-(friend)->Person2)
AND Person1.name = 'Alice';
10 questions
4
votes
2 answers

How to prevent insertion of cyclic reference in SQL

I have the following table: create table dbo.Link ( FromNodeId int not null, ToNodeId int not null ) Rows in this table represent links between nodes. I want to prevent inserts or updates to this table from creating a cyclic relationship…
fractor
  • 1,534
  • 2
  • 15
  • 30
3
votes
1 answer

Syntax to query for optional relationships in Microsoft SQL Server 2017 Graph Database?

I want to select optional relationships in sql-server-2017-graph. Similar to optional in sparql e.g.: PREFIX foaf: SELECT ?name ?mbox WHERE { ?x foaf:name ?name . OPTIONAL { ?x foaf:mbox ?mbox } } from…
1
vote
1 answer

How can I use 'Generate Scripts' in SQL Server 2017 with Graph Database Objects?

I'm attempting to use the Generate Scripts feature of SQL Server Management Studio in order to script the schema and data of a database which has Node and Edge tables included. When I select Schema and Data for Types of data to script in the…
codekaizen
  • 26,990
  • 7
  • 84
  • 140
1
vote
1 answer

Does SqlBulkCopy support Graphtables in MsSql 2017?

I am trying out the new graphdatabase support that was added to Microsoft SQL Server 2017 I wanted to use SqlBulkCopy to insert a couple thousand nodes into a node table. However I always the error: Column…
1
vote
1 answer

Partitioned Graph table - Partition Switch failed

I am trying and partitioning to an existing SQL Server Graph table (node). The table is very large and is taking long time for deletes etc, so hoping to use partitioning to improve the performance. However, when I add partition and try to SWITCH the…
1
vote
1 answer

How to select from SQL Server Graph Table When Where Clause Not Match

I'm using Graph Table in SQL Server . This is my table: --Node Table CREATE TABLE [dbo].[Users] ( [ID] [int] NOT NULL Primary key, [FName] [nvarchar](100) NULL, [LName] [nvarchar](100) NULL )AS NODE --Edge Table CREATE TABLE…
1
vote
0 answers

Error in Creating a Node Table in Sql-server 2017

I have just installed Sql Server 2017 and it's Management studio for practicing Graph database but I have problem creating a Node table. I get an error while creating a Node table and I can not see anything related to the graphs : CREATE TABLE…
PTTT
  • 251
  • 1
  • 10
1
vote
3 answers

Use views and table valued functions as node or edge tables in match clauses

I like to use Table Valued functions in MATCH clauses in the same way as is possible with Node tables. Is there a way to achieve this? The need for table valued functions There can be various use cases for using table valued functions or views as…
1
vote
1 answer

Msg 207 Invalid column name $node_id for pseudo column in inline table valued function

In a Node-table the pseudo column name $node_id refers to the internal name of the node id column and using the pseudo column is recommended (see SQL Graph Architecture §Node Table). For example after creating the following table: create table…
0
votes
0 answers

SQL Server GRAPH: Match Query - not declaring all types [NOT POSSIBLE]

I'm doing research into SQL Server Graph vs Neo4J for my internship. In Neo4J I don't have to declare all types in the (Cypher) MATCH query In SQL Server, it seems that I have to do so Examples: SQL Server: SELECT Restaurant.name FROM Person,…
JochemQuery
  • 1,495
  • 2
  • 26
  • 38