Create test data in SQL Server

后端 未结 6 939
猫巷女王i
猫巷女王i 2021-02-05 20:50

Does anyone have or know of a SQL script that will generate test data for a given table?

Ideally it will look at the schema of the table and create row(s) with test data

6条回答
  •  轮回少年
    2021-02-05 21:27

    I used following way it basically copies data from itself , the data grows exponentially with every execution.Claveat is that You have to have some sample data at first and also you have to execute the query eg I had 327680 rows of data when i started with 10 rows of data .by executing the query just 16 times.Execute one more time and i will hage 655360 rows of data!

     insert into mytable select [col1], [col2], [col3] from mytable 
    

提交回复
热议问题