Learn T-SQL Commands with Samples
Skip Navigation Links
Skip Navigation Links.
Expand DatabaseDatabase
Expand TableTable
Expand ViewView
Expand Stored ProcedureStored Procedure
Expand Data FilteringData Filtering
Expand Data GroupingData Grouping
Expand JoinsJoins
Expand TriggerTrigger
Expand CursorCursor
Expand OperatorsOperators
Expand ConstraintsConstraints
Expand FunctionsFunctions
Expand Conditional ProcessingConditional Processing
Collapse LoopingLooping
Expand Error HandlingError Handling
Expand v.IMP Queriesv.IMP Queries
Expand XMLXML
Expand Query PerformanceQuery Performance
Expand QueriesQueries
Expand NormalizationNormalization
Expand CreateCreate
     

While..Continue

 
      DECLARE @i TINYINT
      DECLARE @s TINYINT

      SET @i = 0
      SET @s = 0

      WHILE   @i < 10
      BEGIN
          SET @i = @i + 1
          SET @s = @s+ @i
          IF  @i < 10     CONTINUE
      END

      SELECT  @s   as   'Sum of first 10 Natural No.s'