BobThornton
Programmer
I run table updates daily. What I want to know is, can I drop table based on the count of another table?
So I run the query that is built with CTE's. The last CTE output is FINAL
What I want to do is -
if the count of FINAL is greater than 1
then
drop table PREV - this contains the data from 2 days ago.
drop table CURR - this contains the data from the previous day.
select * from FINAL into CURR
else
if FINAL not greater than 1 or query gets killed
then exit
So I run the query that is built with CTE's. The last CTE output is FINAL
What I want to do is -
if the count of FINAL is greater than 1
then
drop table PREV - this contains the data from 2 days ago.
drop table CURR - this contains the data from the previous day.
select * from FINAL into CURR
else
if FINAL not greater than 1 or query gets killed
then exit