You can check if the previously created temporary table exists before creating the same table again in your stored procedure. Drop them if they exist.
Code:
// checks that the temporary table 'results' exists in the SQL tempdb.
IF OBJECT_ID('tempdb..#Results') IS NOT NULL DROP TABLE #Results
GO
Top comments (1)
Another way is
DROP TABLE IF EXISTS #YOUR_TEMP_TABLE