Monday, July 17, 2017

Generating Millions of Rows in SQL Server [Code Snippets]

DZone Database Zone
Generating Millions of Rows in SQL Server [Code Snippets]

Often, we have a need to generate and insert many rows into a SQL Server Table. For example, for testing purposes or performance tuning. It might be useful to imitate production volume in the testing environment or to check how our query behave when challenged with millions of rows.

Below please find an example of code used for generating primary key columns, random ints, and random nvarchars in the SQL Server environment.

No comments:

Fun With SQL: Functions in Postgres

DZone Database Zone Fun With SQL: Functions in Postgres In our previous  Fun with SQL  post on the  Citus Data  blog, we covered w...