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
How does recursive cte works in sql server?
Give me a SQL Query to find out the second largest company?
What are user-defined functions (udfs) in sql server?
What is snapshot report?
What are the tools available in market as an alternative to sql server reporting services?
What is named calculation? : sql server analysis services, ssas
Where the sql logs gets stored? : sql server database administration
How can you find out if the current user is a member of the specified microsoft® windows nt® group or microsoft sql server™ role?
What is the use of @@spid?
What is user-defined scalar function?
Do I need a report server to run reports in my application?
What are the difference between data mart and data warehouse? : sql server analysis services, ssas
What is the default sql server instance name?
What is difference between equi join and natural join?
What are audit control procedures?