Lay your weary head to rest and run your query more…

Just coming from a wonderful week at PASS Summit. I sat in two separate sessions where this trick came up and watched as people furiously wrote it down.  Did you know that you can set a query to run multiple times in one command?  All you have to do is add “Go” and the number of times you want it to run.  For example:

GO 5

Will return something like this:


Super cool, right?  It was mentioned in both Brent Ozar’s and Argenis Fernandez’s presentations and I didn’t want to forget. Now you can easily run your queries more and create load on your test system without having to click run over and over again.

Today’s post features Lyrics from Panic! At the Disco’s Cover of Carry On My Wayward Son

About andreaallred

SQL Server and helping people is my passion. If I can make someone laugh, I know I have made a difference.

3 thoughts on “Lay your weary head to rest and run your query more…

  1. Brent Ozar says:

    SO MANY people always write that down, and I’m all, “Why do you want to do that to your poor SQL Server?!? I just taught you a bunch of indexing stuff and you didn’t write anything down, and you wrote THAT down?!?”

    • andreaallred says:

      It made me laugh too! I learned it a few years ago, but seeing everyone go nuts made me take note. Your presentation was awesome and I am excited to use it to show our engineers how we can be better. Thank you for being you!

Leave a Reply

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

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

Facebook photo

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

Connecting to %s