How do I execute the same SQL code multiple times?

June 22, 2008 at 12:21 am Leave a comment

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)

Advertisements

Entry filed under: SQL Scripts. Tags: , , , , , , .

How do I check if a SQL Server 2005 installation has been Service Packed? Randomness – Wallpaper/Images

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


Calendar

June 2008
M T W T F S S
    Jul »
 1
2345678
9101112131415
16171819202122
23242526272829
30  

Archives

Blog Stats

  • 32,558 hits

%d bloggers like this: