Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2002
    Posts
    42

    Unanswered: Is this possible?

    I have a procedure that uses a cursor. I want to use this procedure to build a table based on the cursor. How can I dynamically generate a table the will contain the results. I plan on executing this procedure to populate this table every week.

    Thanks...

  2. #2
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    create procedure...

    declare my_cursor cursor for
    select ...

    open my_cursor
    fetch next ... into <variables list>

    while @@fetch_status = 0 begin
    insert <table_name> values (<variables list>)
    fetch next ... into ...
    end

    close my_cursor
    deallocate my_cursor

    return
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

Posting Permissions

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