Skip to content

Instantly share code, notes, and snippets.

@lennybacon
Last active August 29, 2015 14:02
Show Gist options
  • Save lennybacon/ce93404bf1dcd77786e6 to your computer and use it in GitHub Desktop.
Save lennybacon/ce93404bf1dcd77786e6 to your computer and use it in GitHub Desktop.
Poor Mans SQL Data Generation
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