March 2018
Intermediate to advanced
816 pages
19h 35m
English
This function is similar to the previous one; it returns a graph_id for a given node_id. The following code returns the graph_id for the dbo.TwitterUser node table:
SELECT GRAPH_ID_FROM_NODE_ID('{"type":"node","schema":"dbo","table":"TwitterUser","id":0}');
The return value is 0, as shown in the following output:
--------------------0
It does parse the input string in the same way as the OBJECT_ID_FROM_NODE_ID function and does not validate whether an entry with the returned graph_id exists in the given node table. Therefore, the following code will return a value, even though there is no entry with a value of 567890 for the graph_id in the node table:
SELECT GRAPH_ID_FROM_NODE_ID('{"type":"node","schema":"dbo","table":"TwitterUser","id":567890}'); ...Read now
Unlock full access