Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2006
    Posts
    15

    Unanswered: Set Number of Rows function

    Hello,
    Is there a sybase function to use in a query that gives you a portion of the total number of rows available in a table?
    I am trying to break down the number of rows returned in chunks of a 16Mil table.
    Oracle has a function that goes something like this: MOD(yourcolumn, 5) = 1 - 1. This gives the first fifth of the total number of rows in a Table.
    Your help is much appreciated!!

  2. #2
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    e.g. to break an update into chunks
    Code:
    declare @batchsize int
    select @batchsize=30000
    set rowcount @batchsize
    update bigtab set coid=7885
    where coid=8887
    while @@rowcount = @batchsize
    begin
      update bigtab set coid=7885
      where coid=8887
    end
    set rowcount 0

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •