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 difference between clustered index and non clustered index?

1027


What is the minimum recommended amount of ram for sql server 2012 enterprise?

887


Suppose we have a table "MyTable" containing 10 rows, what query should be executed to update the odd rows "Salary" as 9000?

933


Explain the use of containers in ssis and also their types?

908


What is the difference between createstatement and preparedstatement?

881


What is a join in sql? What are the types of joins?

1007


What are the differences between local and global temporary tables?

1013


What is the difference between varchar and varchar(max) datatypes?

1002


What stored procedure would you use to view lock information?

903


Explain an incremental backup?

937


Is mysql the same as sql server?

913


What method is used by the Command classes to execute SQL statements that return single values?

1004


What are scheduled tasks in sql server?

1009


in the physical file layout, where should the transaction log be stored in relation to the data file? : Sql server administration

1006


How to create function with parameter in sql server?

1039