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 / utpal chakraboarty

Because, Stored procedure is pre-compiled language.

Is This Answer Correct ?    4 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Describe and explain about SQL native client?

614


What to perform pattern match with the like operator?

482


Explain what is meant by replication of database?

531


Define Business Edition in SQL Azure?

88


How will you decide the active and passive nodes?

639






What is inline variable assignment?

599


Why and when do stored procedure recompile?

546


Where do you find the default Index fill factor and how to change it?

597


What are the encryption mechanisms in sql server?

574


In what sequence sql statement is processed?

584


What are the disadvantages of merge replication?

770


I applied Transactional with updatable subscriptions replication on 2 tables now i want to delete those 2 tables but i cannot delete those tables as replication is running how can i stop replication for those 2 tables(but i don't want to delete those replicated tables but i need to stop the replication) how can i do that

1435


how can u get last observation in an unknown dataset ?

1999


How to Check if table exists in sql server?

617


Can We Use Data-grids For Our Report In Ssrs?

147