Archive for June 22nd, 2008
How do I execute the same SQL code multiple times?
Use the command GO. The following example demonstrates how GO can be used to execute the same code multiple times.
SELECT GETDATE() AS CurrentTime GO 3
The result below will be displayed with “Result to Text” mode turned on.
CurrentTime
———————–
2008-06-20 11:52:54.200 (1 row(s) affected)CurrentTime
———————–
2008-06-20 11:52:54.217 (1 row(s) affected)CurrentTime
———————–
2008-06-20 11:52:54.217 (1 row(s) affected)
Add comment June 22, 2008