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

What is the maximum size of a row in sql server?

1004


What is the difference between grant and with grant while giving permissions to the user?

1022


what are the new features in SSRS?

145


Is the primary key column of a table an index in ms sql server?

1001


What is it unwise to create wide clustered index keys?

1042


How to encrypt Strored Procedure in SQL SERVER?

1222


What is the difference between left and right outer join?

1111


What is log shipping? Can we do logshipping with SQL Server 7.0 ?

1048


What are cursors in ms sql server?

1241


What are the difference between primary key and unique key? : sql server database administration

990


What is deploy, process and build? : sql server analysis services, ssas

1153


What is a heap?

1082


What is purpose of normalization?

998


Tell me what is the stuff and how does it differ from the replace function?

1032


Can you explain powershell included in sql server 2008?

988