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

Where is my database stored on the hard disk in ms sql server?

992


Explain how to integrate the ssrs reports in application?

943


How do I start sql server agent automatically?

914


What is user-defined multi-statement table-valued function?

995


What is a performance monitor?

916


What program is used to store the data source file?

902


What does this statement do @@rowcount?

922


How do I view a script in sql server?

975


Explain the types of indexes.

1109


How to apply cascading referential integrity in place of triggers?

965


How to convert numeric expression data types by assignment operations?

1001


Explain view in sql server?

1005


How to create a local temporary stored procedure?

946


What is a Join and explain its types?

1045


Why I have to use stored procedures?

978