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

How can you list all the table constraints in a database?

926


Indexes are updated automatically is the full-text index also updated automatically?

1010


What is outer join in sql server joins?

1102


What is a trace frag? Where do we use it?

1093


What do you understand by a stored procedure?

1084


What are some examples of schemas?

964


How to insert data with null values?

1015


Can we call stored procedure in trigger?

940


Explain the properties of the relational tables?

986


How to find which stored procedure is currently running in sql server?

973


Can two tables share the same primary key?

903


What is the use of =,==,=== operators?

999


What is an entity-relationship diagram (erd)?

1200


What is the difference between mysql and mysqli?

1180


Can you pass expressions to stored procedure parameters?

1022