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 / madhu sudhan g

Hiiii


in Stored Procedures we cannot create same temp table twice if it is in IF else conditions also

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different types of triggers in SQL SERVER?

537


Explain differentiate between a having clause and a where clause?

511


What is a sql join?

570


Describe the functionalities that views support.

655


What is partition in sql server?

528






Explain nested trigger in sql?

588


how many type of indexing in database?

575


Define compound operators?

533


What is inner join in sql server joins?

541


What are the aggregate and scalar functions?

521


What is the difference between nvl and nvl2?

549


can you instantiate a com object by using t-sql? : Sql server database administration

515


How to send a ssrs report from ssis?

125


what is bit datatype? : Sql server database administration

502


Write a query to include a constraint, to check whether the employee salary is greater than 5000?

1110