The A SELECT INTO creates a table for you. There is no need for a CREATE TABLE statement before starting work.
What happens is that you create #ivmy_cash_temp1 in your CREATE statement, then the database tries to create it for you when you execute SELECT INTO . This causes an error because it is trying to create an already created table.
Either remove the CREATE TABLE statement, or modify your query that populates it to use the INSERT INTO SELECT format.
If you need a unique identifier added to your new line, it is better to use SELECT INTO ... since IDENTITY() only works with this syntax.
source share