Loop Keyword in SQL SERVER-BY-SHUBHAM SAXENA @INVENTIVE INFORMATICS

  • Dear Friends ,

    I need to know how to use 'Loop' Keyword in sql satement

    Plz send a sample query ..Can we replace my while loop with 'Loop'

    keyword

    for example:

    declare @var int

    set @var=0

    while (@var!=5)

    begin

    Print('Loop Executed ')

    set @var=@var+1

    end

    how above statement can be replaced by LOOP keyword with FOR in SQL SATEMENTS...

    thanks!!

  • Not sure I understand. How is this related to SSIS?

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • Please don't cross post. It just wastes peoples time and fragments replies.

    No replies to this thread please. Direct replies to: http://www.sqlservercentral.com/Forums/Topic1204585-391-1.aspx

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply