Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2003
    KL, Malaysia

    Wink Unanswered: Creating temporary table using a template table dynamically

    I'm having an application for users to extract data from sql 2K. Problem is that I need to split the huge amount of data into few pages on the application screen.

    Since my order by clause could be dynamic, which is a big problem, the solution I can think of is to populate a temporary table ( within a stored proc ) and assign a column within the temporary table with a running number.

    This stored proc would accept among them, an argument, which is the table name of a base table.

    However, I would like to create this stored proc in such a way that I could create a temporary table based on given based table name, complete with the field sizes and types. On top of that, would like to add a new column to this temp table to store a running number key.

    Opinions appreciated.
    Save the dugongs!

  2. #2
    Join Date
    Aug 2002
    Refer to this linkSQL Performance for information.
    --Satya SKJ
    Microsoft SQL Server MVP

Posting Permissions

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