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

Why use view instead of a table?

706


What is create command?

697


What is the standby server?

680


What is read uncmmited?

786


Scalability, Availability, Integration with internet, etc.)?

2602






How to filter records of table in SQL SERVER?

784


What is the template in sql?

726


Is sql server 2016 free?

695


Explain intellisense for query editing

756


What is the difference between function and stored procedure in sql server?

679


What is federation member?

111


Find nth lowest salary or get nth lowest salary?

791


what is a self join? : Sql server database administration

691


Explain about thread and memory management process of SQL?

721


What is similarity and difference between truncate and delete in sql?

765