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 / murthy
The #Temp table created in this stores procedure exists in
memory as long as the Particular session is closed. Hence
drop the table at the end of the procedure.
Note: In case if you exec the SP using Management studio,
close the connection and re-open it, it will work without
modifying anything.
| Is This Answer Correct ? | 1 Yes | 3 No |
Post New Answer View All Answers
What are extended events in sql server?
How to sort query output in descending order in ms sql server?
What are drillthrough reports?
Ms sql server index?
What is query optimization process?
Data table as parameter in sql server?
what is the sql equivaent of the dataset relation object ?
Why variables called the most powerful component of ssis?
Tell me can we use custom code in ssrs?
List the data types available in mssql?
why would you call update statistics? : Sql server database administration
What is checkpoint process in the sql server?
What is primary key and example?
What is create statement?
What is a transact-sql statement batch in ms sql server?