Owning the Spelling Suggestion Feature

  • Try this to create and populate the table with numbers:

    CREATE TABLE [#tblNumbers]( [number] [int])

    Go

    insert #tblnumbers(number) values( 1)

    Go 100

    Declare @i int

    Set @i = 0

    Update #tblnumbers

    set @i = number = @i+1

    --select * from #tblnumbers

    --truncate table #tblnumbers

    Go 100 - will execute the batch 100 times as somebody mentioned on this site a while ago.

    set @i = number = @i+1

    is a trick pointed out in the book "Inside Microsoft SQL Server 7.0 "

    by Ron Soukup and Kalen Delaney to get running totals. This is a valid syntax for UPDATE statement.

    Regards,Yelena Varsha

Viewing post 16 (of 15 total)

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