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 to download and install the scaled-down database adventureworkslt?
How to how to convert numeric expression data types using the convert() function??
What is the new security features added in sql server 2014? : sql server security
Find nth lowest salary or get nth lowest salary?
Explain multiserver query
What is normalization and what are the advantages of it?
How to deploy the Report?
How to check if a table is being used in sql server?
Working with TLogs
What is proper subset of candidate key?
How to add a new dsn with the odbc driver for sql server?
Which are the third-party tools used in sql server and why would you use them?
What is advantage data architect?
what are cursors? : Sql server database administration
Explain intellisense for query editing