Created
October 9, 2019 14:59
-
-
Save ghotz/485c07c118b32717dffeb0d464027a5b to your computer and use it in GitHub Desktop.
Create a table for quick testing with random data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DROP TABLE IF EXISTS dbo.test; | |
| CREATE TABLE dbo.Test ( | |
| ID int IDENTITY(1, 1) NOT NULL PRIMARY KEY | |
| , PayLoad nvarchar(1000) NOT NULL DEFAULT (REPLICATE(CHAR(33 + ABS(CHECKSUM(NEWID())) % 90), ABS(CHECKSUM(NEWID())) % 1000)) | |
| ); | |
| GO | |
| SET NOCOUNT ON; | |
| DECLARE @i int = 10000; | |
| WHILE @i > 0 | |
| BEGIN | |
| INSERT dbo.Test DEFAULT VALUES; | |
| SET @i = @i - 1; | |
| END | |
| GO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment