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 / saravanan p

Since the stored procedure precompiled, we cannot give same
table name in both the If and else part.

It will work if give some other name in else part.

Is This Answer Correct ?    11 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

you notice that the transaction log on one of your databases is over 4gb the size of the data file is 2mb what could cause this situation, and how can you fix it? : Sql server administration

904


how do you implement one-to-one, one-to-many and many-to-many relationships while designing tables? : Sql server database administration

1009


What is NOT NULL Constraint in sql server 2012?

934


How to drop existing indexes in ms sql server?

1013


Can sub report data source be different from that of the parent report?

135


What is the difference between ddl,dml and dcl commands?

1056


Are there issues when exporting SSRS reports into Microsoft Excel? When my users are trying to export a SSRS report into Microsoft Excel, one or two columns in the report appear to merge together. Why might this be?

181


What are the advantages of paper records?

907


How to convert numeric expression data types by assignment operations?

1001


Explain syntax for dropping triggers?

884


What is BLOCK statements in SQL?

1205


What is ms sql server index?

1021


How to enable tcp/ip protocol on a sql server?

1090


What is the difference between for trigger and after trigger?

1022


What is a covering index?

917