Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Temporary table name

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-08-31 : 09:54:50
Charles Sirait writes "Hi,
I have a major problem while creating a stored procedure. My query goes something like this

*****
--...other statements

--check for customer type
if @cust_type = 'P'
begin
  --...
  select * into #temp1 from personal_cust
end
else
begin
  --...
  select * into #temp1 from corporate_cust
end

--retrieve records from #temp1
select * from #temp order by cust_id
*****

With statements above I received following error meg:
"There is already an object named '#temp1' in the database."

Pls somebody tell me how to solve this problem. Thanks.

Regards,

Charle Sirait"
   

- Advertisement -