Hello ,
we generate daily backup of d_stockiest table with timestamp appended.
i wrote dynamic sql loop query for deleting all backup tables one by one except recent 5 backup tables.
but it gives bellow error :"Cannot drop the table 'd_stockist_hq_mapping_bkp_20171010173223', because it does not exist or you do not have permission".
because name of table to be deleted is dynamic so i cant drag that metadata on sql operation.
if i run these query on sql server it works n it gives below result
please suggest solution