Cloud Training (Online)

Print a text N number of times in SQL Management Studio

When working with SQL Management studio , you might need to display a string N number of times , in this case , simply use the GO command and specify the number of times you want the batch to be repeated.

How to print a text ‘N’ number of times in SQL Management Studio ?

For example , you want to display a string ‘This is’ 10 times. Here’s how you will do it.

PRINT 'This is'
GO 10


Senthil Kumar B
Senthil Kumar is a former Microsoft MVP (Most Valuable Professional). He is a Co-Author of the book "Windows 10 Development Recipes using JavaScript and CSS" for Apress Publication. He is a technical presenter, blogger, mentor and a Geek.  Senthil is a regular speaker is various local user groups. He has presented at conferences like Great Indian Developer Summit (GIDS) & Microsoft DevCamps. You can reach out to him via his Twitter handle @isenthil.