SQL Flow Field Guide

INSERT (SQL Graph)

Catalog support for SQL Server 2022 (16.x) and 2025 (17.x)

inserts graph nodes or edges

What changes

Input
VALUES or SELECT including $node_id lookups
Output or change
node table or edge table rows ($from_id/$to_id for edges)

Syntax at a glance

[ WITH <common_table_expression> [ ,...n ] ] INSERT { [ TOP ( expression ) [ PERCENT ] ] [ INTO ] { <object> | rowset_function_limited [ WITH ( <Table_Hint_Limited> [ ...n ] ) ] } { [ (column_list) ] | [(<edge_table_column_list>)] [ <OUTPUT Clause> ] { VALUES ( { DEFAULT | NULL | expression } [ ,...n ] ) [ ,...n ] | derived_table | execute_statement | <dml_table_source> | DEFAULT VALUES } } } [;]

Work example

A controlled task needs the behavior documented for INSERT (SQL Graph) before it is added to a batch.

Read the linked Microsoft syntax and test INSERT (SQL Graph) with synthetic input in an isolated database. Record its scope, permissions, and error path.

Check your work INSERT (SQL Graph). The observed INSERT (SQL Graph) behavior matches its written purpose and the test has no effect on permanent data or credentials.

Open Microsoft Learn for full syntax, permissions, and details for your version.