Wednesday, 3 August 2011

SQL Server, GO xx will repeat the query xx times

INSERT INTO MyTable (SomeColumn) VALUES('baaa')
GO 44

The above will repeat the insert query 44 times. Very handy when you need to generate some dummy test data and your table supports that (i.e. has autonumber or identity column)

No comments:

Post a Comment