While taking my training classes for SQL Server, students ask many times if they can get some large sample tables to do perfroamce tuning. So I thought of writing a script to generate the sample data as per my need. To use this script to generate data, you need to have AdventureWorks2012 DB on that machine. If you don't have it, you may download it from :
Then you may run the script to generate sample data in table AllCustomerOrders. You just need to specify how many rows you want to generate. e.g. to generate 100 records, I have specified it like this:
Declare @RowsRequired Bigint =100
So instead of 100, you may specify a big number.