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 types of replication are supported in sql server?

1109


What is the difference between the application object and session object?

1118


Differentiate between ms sql server reporting services vs crystal reports?

944


Which tcp/ip port does sql server run on? How can it be changed?

1079


What is implicit cursors?

1127


How to list all tables in the database using odbc_tables()?

1113


Your sql server is running out of disk space. You notice that there are several large files with ldf extensions what are these files?

1249


Define candidate key, alternate key, and composite key.

965


What is the command used to check locks in microsoft sql server?

1094


Do you know what is openxml in sql server?

1113


What is the parse query button used for?

1080


Why use “nolock” in sql server?

1131


How to check table values in sql server?

1007


what is a transaction and what are acid properties? : Sql server database administration

1083


Can sql servers link to other servers like oracle?

890