Subscribe to RSS feed  Follow @jackvamvas - Twitter

*Use the Comments section for questions Links


SQL Server DBA Jobs

How to use GO command for multiple execution of sql statements

03 March,2016 by Tom Collins

A useful feature of the GO command is the possibility of using the count Argument. For example, if  I issue this

sql staement through SSMS , it will run the once:

select @@servername


but if you execute the following sql statement , it will run three times

select @@servername
GO 3


This is a fairly simple example.

It is possible to extend this idea into a very simplistic performance testing or functionality testing method. I stress the word simple. In a more comprehensive test, you might use a product such as JMeter  where you can simulate some workload. The approach you take will depend on the Performance Metrics used in acceptance tests

Read more on testing

SQL Server test data generation testing tools - SQL Server DBA

TPC-H generate test data , test queries and sql database benchmark ...

SQL Server - Correctness and stress test - SQL Server DBA

Author: Tom Collins (


Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.


Post a comment on How to use GO command for multiple execution of sql statements | SQL Server Performance Tuning | SQL Server DBA:Everything | FAQ | Contact|Copyright & Disclaimer