Sunday, February 19, 2012

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.....SELECT NC_ID,
AUD_PLAN_ID,
AUD_CLAUSE_ID
into
#tmp_table
FROM AUD_NC|||Thankx Mallier........... It works........:)

No comments:

Post a Comment