Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 / soorai ganesh

Problem in #temp table. Because it comes twice in SP.
(U can say it is in else part. But compiler will not accept
this.First it will compile everthing then running the SP. )

Its better to keep another name for Else part table.......

Is This Answer Correct ?    8 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Do you know how to store and query spatial data?

992


What is a print index?

849


What is dynamic cursor in SQL SERVER?

1012


What is the fastest way to permanently delete a 1 million row table named customers?

1175


How do I create a trace in sql server?

974


What is sql server transaction log file?

1001


Why do we backup Active Directory ?

1002


Explain the steps to use transact-sql cursor?

975


Tell about MOM Tool(Microsoft Operator Manager)?

1864


Define Business Edition in SQL Azure?

100


What is the function of sql server agent windows service?

1038


What is “begin trans”, “commit tran”, “rollback tran” and “savetran”?

979


What are the steps to take to improve performance of a poor performing query? : sql server database administration

989


Difference between uniqe index and uniqe constraint?

928


how you can list all the tables in a database?

978