I created a stored procedure, scheduled every night, that delete multiple tables and then re-insert rows in them from views.
All the tables are populated but one that remains empty.
The strange thing is that if I run the procedure MANUALLY, the table is populated.
My code is like this:
DELETE FROM mytable INSERT INTO mytable SELECT * FROM VW_mytable UPDATE mytableset set month= RIGHT('0' + CONVERT(VARCHAR, month), 2) UPDATE mytableset set period = CONCAT(year,month)
Anyone had the same issue?