Created
November 2, 2017 14:15
-
-
Save musukvl/f01c22a60e54859c72070a1c84abe2d3 to your computer and use it in GitHub Desktop.
Insert 100 000 from C# code
This file contains 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
using (var dbContext = new MainDbContext()) | |
{ | |
for (var i = 0; i < 100000; i++) | |
{ | |
dbContext.Database.ExecuteSqlCommand( | |
@"INSERT INTO [dbo].[Log] ([Key], [Data], [UpdatedDate]) | |
VALUES ( | |
convert(nchar(36), NEWID()), | |
'Some random data:' + convert(nchar(36), NEWID()), | |
GETDATE())"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment