Results 1 to 3 of 3
  1. #1
    Join Date
    May 2004
    Location
    bangalore
    Posts
    270

    Unanswered: Copy Tabular Structure into a temp table

    Hello Room,
    M stuck with an issue with SQL Query. My requirement is to create a temporary table with the out put of "SELECT" Clause..........

    Like.......
    SELECT NC_ID, AUD_PLAN_ID, AUD_CLAUSE_ID FROM AUD_NC

    This is my "Select" Query and all I want is to store the out put in a #table. Now one way is to craete #tmp_table with the fields same as the out put column of the "SELECT" Clause......... But I want it in direct fashion.... dat means without Creating the #tmp_table directly...........

    I tried with "CREATE TBALE #tmp_table AS SELECT NC_ID, AUD_PLAN_ID, AUD_CLAUSE_ID FROM AUD_NC".......... But it dini work

    Please help me out in this regard......

  2. #2
    Join Date
    Jun 2003
    Posts
    269
    Code:
    SELECT  NC_ID, 
     AUD_PLAN_ID, 
     AUD_CLAUSE_ID 
    into 
     #tmp_table 
    FROM  AUD_NC
    I love cursor,though I never use it.Cos' I dont want to misuse it.
    ----------------------------------------------

    ----cheers
    ----http://mallier.blogspot.com

  3. #3
    Join Date
    May 2004
    Location
    bangalore
    Posts
    270

    Its working.........

    Thankx Mallier.............. It works..........

Posting Permissions

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