Skip to content

Commit 97d02e8

Browse files
mkincaid-bwrkac-bw
andauthored
Updated user defined types section (#798)
* Updated user defined types section * Added detail to user-defined types. * Removed specific user-defined types. --------- Co-authored-by: rkac-bw <148072202+rkac-bw@users.noreply.github.com>
1 parent f2e0895 commit 97d02e8

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

  • docs/contributing/code-style

docs/contributing/code-style/sql.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -536,15 +536,17 @@ WHERE
536536

537537
### User defined types
538538

539-
- **User Defined Type Name**: `[Schema].[TypeName]` (e.g., `[dbo].[GuidIdArray]`)
540-
- The name should describe the type
539+
New user defined types should not be created. The following existing types may be used as
540+
table-valued parameters in stored procedures:
541541

542-
```sql
543-
CREATE TYPE [dbo].[TypeName] AS TABLE
544-
( [Column1] DATATYPE NOT NULL,
545-
[Column2] DATATYPE NOT NULL
546-
);
547-
```
542+
- **`[dbo].[GuidIdArray]`** — a single-column table of `UNIQUEIDENTIFIER` values. Use when passing a
543+
list of IDs to a stored procedure (e.g., bulk reads or deletes).
544+
545+
- **`[dbo].[TwoGuidIdArray]`** — a two-column table of `UNIQUEIDENTIFIER` pairs (`Id1`, `Id2`). Use
546+
when an operation requires two related IDs per row (e.g., user ID + organization ID).
547+
548+
- **`[dbo].[EmailArray]`** — a single-column table of `NVARCHAR(256)` email addresses. Use when
549+
passing a list of emails to a stored procedure.
548550

549551
### Indexes
550552

0 commit comments

Comments
 (0)