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 / murthy

The #Temp table created in this stores procedure exists in
memory as long as the Particular session is closed. Hence
drop the table at the end of the procedure.

Note: In case if you exec the SP using Management studio,
close the connection and re-open it, it will work without
modifying anything.

Is This Answer Correct ?    1 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how many types of relationship?

1029


How to specify the collation for a character data type in ms sql server?

1030


Define left outer join?

972


Explain primary key?

969


What is the difference between indexing and hashing?

1169


What's new in sql management studio for sql server? : sql server management studio

1065


Do you know what are acid properties?

1080


How to encrypt Strored Procedure in SQL SERVER?

1167


What is report snapshot in ssrs?

269


why does a sql statement work correctly outside of a user-defined function, but incorrectly inside it? : Sql server administration

1068


What are the advantages of passing name-value pairs as parameters?

1168


Can we perform backup restore operation on tempdb?

1017


What options are there to delete rows on the publisher and not on the subscriber? : sql server replication

1216


How to generate create procedure script on an existing stored procedure?

1011


Explain what are the different index configurations a table can have?

1113