Getting Started with Adobe After Effects - Part 6: Motion Blur
A collection of quick technology learning tips from what people around you learn every day

Many, many, many GO

Apr 13 2012 12:00AM by Adam Tokarski   

I saw today, in someones code, something like this:

GO 100

At first, I thought that was some typing mistake, but then I found that GO has not only function of ending batch, but also it can execute that batch many times, as specified in:

GO [count]

It may be useful to make Inserts, in place of WHILE Loops, ie:

CREATE TABLE #t (someValue BIGINT)
INSERT INTO #T(someValue) SELECT 1
GO

INSERT INTO #T(someValue) SELECT SUM(someValue) FROM #T
GO 50

SELECT * FROM #T


Edited:
Ok, I already found that post from Madhivanan.

Read More..   [21 clicks]

Published under: SQL Server Tips ·  ·  ·  · 


Adam Tokarski
58 · 3% · 1021
17
 
9
 
11
 
0
Incorrect
 
0
Interesting
 



Submit

4  Comments  

  • It may be useful to make Inserts, in place of WHILE Loops, ie:

    Just remember that it will still do single inserts and will likely be as slow as a WHILE loop. ;-)

    commented on Apr 13 2012 12:16PM
    Jeff Moden
    160 · 1% · 298
  • @Jeff: thanks for vigilance!.
    You're right, but I was not able to run into a better idea of an example.

    commented on Apr 13 2012 12:52PM
    Adam Tokarski
    58 · 3% · 1021
  • Hi All...I have a similar requirement where I need to insert data n times. Means need to create n rows . 'n' will be entered by user in UI. Is there any more efficient way than go or while loop.

    commented on Apr 16 2012 1:11AM
    satyajit
    124 · 1% · 402
  • @satyajit: of course, you can find it, but it depends on context of your technology.
    Maybe you will be able to create some (long) string of values - at your client app - that you will send with INSERT INTO? Or, maybe, if there is so much data to process, you should save it in text file, then fire off bulk insert?

    commented on Apr 16 2012 1:59AM
    Adam Tokarski
    58 · 3% · 1021

Your Comment


Sign Up or Login to post a comment.

"Many, many, many GO" rated 5 out of 5 by 17 readers
Many, many, many GO , 5.0 out of 5 based on 17 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]