You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/t-sql/statements/create-table-sql-graph.md
+16-2Lines changed: 16 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -111,15 +111,19 @@ This document lists only arguments pertaining to SQL graph. For a full list and
111
111
Creates an edge table.
112
112
113
113
*table_constraint*
114
-
Specifies the properties of a PRIMARY KEY, UNIQUE, FOREIGN KEY, CONNECTION constraint, a CHECK constraint, or a DEFAULT definition added to a table
114
+
Specifies the properties of a PRIMARY KEY, UNIQUE, FOREIGN KEY, CONNECTION constraint, a CHECK constraint, or a DEFAULT definition added to a table.
115
+
116
+
> [!NOTE]
117
+
> CONNECTION constraint applies only to an edge table type.
115
118
116
119
ON { partition_scheme | filegroup | "default" }
117
120
Specifies the partition scheme or filegroup on which the table is stored. If partition_scheme is specified, the table is to be a partitioned table whose partitions are stored on a set of one or more filegroups specified in partition_scheme. If filegroup is specified, the table is stored in the named filegroup. The filegroup must exist within the database. If "default" is specified, or if ON is not specified at all, the table is stored on the default filegroup. The storage mechanism of a table as specified in CREATE TABLE cannot be subsequently altered.
118
121
119
122
ON {partition_scheme | filegroup | "default"}
120
123
Can also be specified in a PRIMARY KEY or UNIQUE constraint. These constraints create indexes. If filegroup is specified, the index is stored in the named filegroup. If "default" is specified, or if ON is not specified at all, the index is stored in the same filegroup as the table. If the PRIMARY KEY or UNIQUE constraint creates a clustered index, the data pages for the table are stored in the same filegroup as the index. If CLUSTERED is specified or the constraint otherwise creates a clustered index, and a partition_scheme is specified that differs from the partition_scheme or filegroup of the table definition, or vice-versa, only the constraint definition will be honored, and the other will be ignored.
121
124
122
-
## Remarks
125
+
## Remarks
126
+
123
127
Creating a temporary table as node or edge table is not supported.
124
128
125
129
Creating a node or edge table as a temporal table is not supported.
@@ -159,6 +163,16 @@ The following examples show how to create `EDGE` tables
159
163
CREATETABLElikesAS EDGE;
160
164
```
161
165
166
+
The next example models a rule that **only** people can be friends with other people, which means this edge does not allow reference to any node other than Person.
167
+
168
+
```
169
+
/* Create friend edge table with CONSTRAINT, restricts for nodes and it direction */
0 commit comments