Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004
    Location
    India
    Posts
    41

    Unanswered: Need a help in sql

    Hi Everbody,

    I have got the table t with n rows.
    I want to fetch the rows and insert into 10 different tables with equal
    number of rows.

    Can this prblm be solved without writing a cursor?

    Thanks in Advance ,
    Arun

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >Can this prblm be solved without writing a cursor?
    It depends upon what is allowed & what is not allowed.
    What happens when "n" is not evenly divisible by 10?
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    If you mean to do it in a single statement - no, it is not possible. To insert data into 10 different tables, you'll need 10 different statements (difference, if nothing else, will be target table name).

    By the way, what's wrong with writing a cursor?

  4. #4
    Join Date
    Mar 2002
    Location
    Reading, UK
    Posts
    1,137
    Have a look at the INSERT ALL statement it might do what you want.

    Alan

Posting Permissions

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