Last active
August 29, 2015 14:02
-
-
Save lennybacon/ce93404bf1dcd77786e6 to your computer and use it in GitHub Desktop.
Poor Mans SQL Data Generation
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
SET IDENTITY_INSERT [LogEntry2] ON; | |
GO | |
WHILE (SELECT COUNT(*) FROM [LogEntry2]) < 2500000 | |
BEGIN | |
INSERT INTO [LogEntry2] | |
( | |
[LogEntry2].[Id] | |
, [LogEntry2].[Culture] | |
, [LogEntry2].[Created] | |
, [LogEntry2].[CreatedBy] | |
, [LogEntry2].[Modified] | |
, [LogEntry2].[ModifiedBy] | |
, [LogEntry2].[Deleted] | |
, [LogEntry2].[Number] | |
, [LogEntry2].[DateOccurred] | |
, [LogEntry2].[EventId] | |
, [LogEntry2].[Log] | |
, [LogEntry2].[Source] | |
, [LogEntry2].[LogEntryType] | |
, [LogEntry2].[TraceLevel] | |
, [LogEntry2].[Category] | |
, [LogEntry2].[Message] | |
, [LogEntry2].[Machine] | |
, [LogEntry2].[Process] | |
) | |
SELECT | |
NEWID() AS [Id] | |
, [Culture] | |
, [Created] | |
, [CreatedBy] | |
, [Modified] | |
, [ModifiedBy] | |
, [Deleted] | |
, [Number] | |
, [DateOccurred] | |
, [EventId] | |
, [Log] | |
, [Source] | |
, [LogEntryType] | |
, [TraceLevel] | |
, [Category] | |
, [Message] | |
, [Machine] | |
, [Process] | |
FROM [LogEntry]; | |
PRINT 'ANOTHER BATCH INSERTED...' | |
END | |
GO | |
SET IDENTITY_INSERT [LogEntry2] OFF; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment