Click here to Skip to main content
15,890,579 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to create a temp table in my stored procedure in which one field is i am getting using scope_identity() other field is itself an identity. What i want is that the temp table should get rows (which are multiple ) corresponding to the single value of scope identity. like
HTML
columnA ColumnB

111        X

111        Y

111        z

and then i want these values to be inserted into my original table. Is it possible How?

Thank you
Posted
Updated 14-Oct-13 20:50pm
v2
Comments
coded007 15-Oct-13 2:55am    
Can you give any demo code and explain more clearly

1 solution

If you use scope identity for storing another table identity field,and then you want to insert it's value to your temp table, you should consider that if your temp table has also an identity column, the value of scope identity is changing during each insertion to temp table,
so you must store the value of scope identity in another variable and then use it for insertion.

as a solution you can store scope identity into another variable.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900