Question : Problem while adding additional IDENTITY column to the existing temporary table?

Hi All, i have different situation where i am selecting from 4 tables into temporary table and one of these table contains identity column, so while i am selecting the records into this temp table the IDenity column is also creating, my logic needs to have new identity column for this results and columns from this 4 tables are always variant so can any one suggest what should be the best solution for this problem.
I have two options but i feel these are not optmized.
1) adding another column and copy the Idenitity column values into the new column then dropping the identity column
2) changing the sytem configuration files but needs addition permissions

Answer : Problem while adding additional IDENTITY column to the existing temporary table?

that was the whole point behind my suggestion of  : select * into my_temp_table from my_real_table
ie to retain the int value, but it is no longer an identity column in my_temp_table, and it is dynamic in so much s you do not have to create a table first and it will alwyas reflect the current structure. You must drop that table first though, subsequent select into's will fail if using the same table name.

but then you said you wanted another identity, so the next suggestion was to add that - and if that is not needed, then don't add it.

I believe you have just echoed my solution albeit without adding the new identity (having previously confirmed that it is needed per "rownum in Oracle").
Random Solutions  
 
programming4us programming4us