How to store result of a stored procedure in a table variable (Sql Server)

Table variables are very useful to store intermediate results in between a dynamic query or a large query whose results need to be fed into another sql query. Hence there are many times, when we encounter a situation where we need to store result of a stored procedure execution into a table variable to be used further by another query.
Let’s see how we can do that. For this first I have Created some sample table & Data. Continue reading

Advertisements