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 are the properties of primary key?
What is catalog views?
How to create a user name in a database?
How to list all schemas in a database?
Do you know sql server 2008 introduces automatic auditing?
How do we Backup SQL Azure Data?
How to view the error log for any specific instance? : sql server database administration
How can you manage sql azure security?
Is there any difference between primary key and unique with the not null condition?
What is the difference between Clustered and Non-Clustered Index?
Explain a join?
What is a result set object returned by mssql_query()?
Which language is supported by sql server?
What is auditing in sql server?
1.how to find the dead lock in sql server? 2.How to fine the memory leaks in sql server? 3.suppose transaction log file increasing what action will take ?