Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3668

Re-using Table Variable in Procedure

$
0
0

Hi,

 

I need to clear content of a table variable (which had data from database table TABLE1) an resue it later in my procedure to select data from different database table say TABLE 2. How do I do this. Trying to reuse gives error as the definitions of the 2 tables are different.

 

e.g.:

 

var1 = SELECT * FROM TABLE1;

 

-- Some logic where I use var1

 

var1 = SELECT * FROM TABLE2;

 

Above statement gives error as var1 is already binded to definition of TABLE1.

 

Thanks,

Anoop


Viewing all articles
Browse latest Browse all 3668

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>