We are writing a stored procedure to perform a 'select into' a temp table. The issue is that the temp table has already been created earlier in the SP. This seems to be causing an error when we try to install the SP. Below is the logic in the SP.
1. create table #sometable (column1 char(15) , column2 char(1) )
2. select column1, '' into #sometable from permtable1 (nolock) where CustomerID = @CustomerID
When we try to install this SP, we get the error below.
Error: There is already an object named '#sometable' in the database.
Is it not possible to perform a bulk operation into an existing temporary table?