rightonthego.blogg.se

Dummy data generator for sql
Dummy data generator for sql




dummy data generator for sql

Note:Keep in mind that if it has a Identity filed, change it's Identity Specification to No Since you are supposed to fill the new table by the data of the original one repeatedly. Name your new table to something else like dbo.CustomersTest, Now you can execute the query to have a new table with similar structure with the dbo.Customers. Right click on it and select Script Table as > Create To > New Query Editor Window If you want to have a table which is filled a little bit more elaborated then you can achieve that the same way this time by executing a simple query and following these steps:Ĭhoose one of your tables which has a remarkable number of rows, say dbo.Customers This is sort of an arithmetic progression, so it's going to last a little, don't use a big number in front of GO. SELECT Id, FirstName, Last Name FROM dbo.CustomersĪn explicit value for the identity column in table 'dbo.Customers' can only be specified when a column list is used and IDENTITY_INSERT is ON. SELECT FirstName, Last Name FROM dbo.Customers

dummy data generator for sql

In the case one or more column are identity (meaning they accept unique values, if it's auto incremental), you just don't place it in your query, for instance if Id in dbo.Customer is identity, the query goes like this: INSERT INTO dbo.Customers It will make a table with 1000 same rows in it.Īnother solution is that you can populate the beginning rows of your table with some data, then you fill the next rows of table by repeating the beginning rows over and over, it means you fill your table by itself: INSERT INTO dbo.Customers You Only need Go 1000 after your INSERT, to fill it 1000 times, just like this: INSERT INTO dbo.Cusomers(Id, FirstName, LastName) VALUES(1, 'Mohamed', 'Mousavi')






Dummy data generator for sql