create procedure proc1 (@a int)
as
begin
if @a=1
create table #temp(a1 int)
else
create table #temp(a1 int)
end
while executeing the above code it shows error
like '#temp already exist' .why it shows an error?
Answer Posted / david
it indicates that some one had already executed the stored
proc but forgotten to delete the temp table they have
created.
normally before closing that particular transaction within
the SP we need to use drop table statement.
| Is This Answer Correct ? | 1 Yes | 10 No |
Post New Answer View All Answers
In which sql server version report builder introduced?
How can you insert null values in a column while inserting the data?
explain different types of backups avaialabe in sql server? Given a particular scenario, how would you go about choosing a backup plan? : Sql server database administration
What to check if a User database is locked?
What are the general features of sql server management studio? : sql server management studio
Does view occupy space?
How many clustered indexes can be created on a table? I create a separate index on each column of a table. what are the advantages and disadvantages of this approach?
What is the beast way to write CTE in SQL Server ?
Determine when an index is appropriate?
What is difference between join and natural join?
How do you delete a data source?
What is the use of keyword with encryption.
How to list all triggers in the database with sys.triggers in ms sql server?
What does truncate do?
Can we use where clause with group by?