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 stored by the master? : sql server database administration
What is a document index?
hi, how to link a text file and a .rpt file in my tables of sql server and to retrieve those records for further use. reply me as soon as possible.
Explain what is meant by replication of database?
Can we shrink data file in sql server?
Do you know what is a trace frag? Where do we use it?
What is sub-query in sql server?
Can one drop a column from a table?
How do I manually uninstall an instance of sql server 2016?
Explain trigger and its types?
What is a synonym for manipulation?
Which are the two editions in which SQL Azure database available?
What is sql server english query?
Write the syntax for stuff function in an sql server?
What do you mean by subquery?