--- title: "User-Defined Row IDs for Tables" slug: "user-defined-row-ids-for-tables" tags: ["5.5"] updated: 2026-10-27T23:00:54Z published: 2026-10-27T23:00:54Z canonical: "docs.vastdata.com/user-defined-row-ids-for-tables" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.vastdata.com/llms.txt > Use this file to discover all available pages before exploring further. # User-Defined Row IDs for Tables You can expose the row IDs in VAST Database tables and control the allocation of row IDs for inserted data. This is helpful if you want to use only a specific range of rows when inserting or querying table data. ## Exposing Row IDs To expose the row ID in a table, create a column with these attributes: | Column name | vastdb_rowid | | --- | --- | | Type | int64 | Although the `vastdb_rowid` field has `int64` type, the value of a user-defined row ID cannot be larger than 2^47. ## Controlling Allocation of Rows Using the User-Defined Row IDs To insert information into specific table rows, specify the row ID you want in the INSERT statement, as in this example: ```plaintext INSERT INTO TABLE (vastdb_rowid=ROW, data1, data2, data3) ``` This will insert data1, data2 and data3 into the table at the row ROW. > [!NOTE] > Note > > If you include the row ID for an INSERT, as in the example above, you must use row IDs in all subsequent INSERTS into the table. You cannot mix INSERTS with user-allocated rows, and internally allocated rows (by leaving out the row ID). To query data from a specific range of table rows: ```plaintext SELECT * FROM TABLE WHERE vastdb_rowid>ROW1 and vastdb_rowid [!NOTE] > Note > > You can mix queries on the table using the row IDs with queries that do not use row IDs.