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:
Post a Comment