I create a temp table. Then I run a With statement. I put the results in a temp table and then, after I use the data, I can not delete it because this error shows up: "There is already an object named '#ArmadoPlantilla' in the database."
What am I doing wrong?
Make sure you drop your temp table after you are done with it. Sounds like you created your temp table, used it and then left the stored proc (or whatever) without dropping it. I typically use this method (though @Giscard's may work):
CREATE TABLE #ArmandoPlantilla(
whatever int,
whateverAgain char(30) )
--sql inserting records and doign stuff with the temp table
drop table #ArmandoPlantilla -- **HERE** Are you missing this?
Also... post your freaking code. Are you trying to make this hard for us?