Query Ocient
General SQL Syntax

Generate Tables Using sys.dummy

sys.dummy is a virtual table that the

 generates with a specific number of rows. This table is a handy tool to quickly create tables for testing without scripting extensive DDL commands.

When you execute sys.dummy, the database creates a table with a single column, which is automatically populated with incremental integers.

sys.dummy follows similar rules to a table reference. The command must specify a positive integer that represents the number of rows for the command to generate in the table.

In this syntax block, the {N} parameter represents the number of rows for sys.dummy to generate. Do not specify curly brackets with this parameter in queries.

Syntax

SQL


Example

In this example, sys.dummy creates a table with 10 rows.

SQL


Output:

SQL


Related Links

SQL Reference