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

What is raid? : SQL Server Architecture

1163


What is the minimum and maximum number of partitions required for a measure group? : sql server analysis services, ssas

1038


What are sub reports?

201


What are different types of database indexes?

1084


SQL Server Architecture ?

2439


Is it possible to update the views? If yes, how, if not, why?

1016


How do I create a trace in sql server?

1023


How to create sub reports?

242


When columns are added to existing tables, what do they initially contain?

1023


What are two difference between sql azure and azure tables?

159


Do you know data definition language, data control language and data manipulation language?

1034


Is there any difference between primary key and unique with the not null condition?

938


How can a user-defined datatype be created?

981


What are the types of containers in ssis?

1159


what number files will a information contain in SQL Server? How many forms of information files exist in SQL Server? How many of those files can exist for a single database?

1051