0

The following code works properly without using go keyword in sql-server2008.

DECLARE @intFlag INT
SET @intFlag = 1
WHILE (@intFlag <=5)
BEGIN
PRINT @intFlag
SET @intFlag = @intFlag + 1
END
GO

I could not understand the use of go here. If we have more than one while loop in that case how many go keyword we use. Please help me, I'm a little bit confused.

StarsSky
  • 6,721
  • 6
  • 38
  • 63
user3424829
  • 121
  • 1
  • 3
  • 10

1 Answers1

0

GO is not really a keyword in SQL it's a batch terminator, used for breaking up scripts into sections its also not specific to SQL, as other MS tools use it.

fuzzybear
  • 2,325
  • 3
  • 23
  • 45