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 / lee
yep problem is with the compiler.. I had to think of
another way to solve the problem, eg, I created the #temp
without the IF statement and then used an IF ELSE statement
to modify or update #temp, make sense?
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What do you understand by SQL*Net?
What are the 3 types of schema?
How to Update from select query in sql server?
What is executereader?
Explain sub-query?
What happens if null values are involved in datetime operations?
Why use sub query in sql server and list out types of sub queries?
What is the meaning of lock escalation and why/how to stop this? : sql server database administration
Who is the owner of a schema in ms sql server?
Is port 1433 secure?
what are the reporting service components in SSRS?
Which language is supported by sql server?
Can a cursor be updated? If yes, how you can protect which columns are updated?
What is an identity column in insert statements?
Can we use where clause with group by?