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 / soorai ganesh

Problem in #temp table. Because it comes twice in SP.
(U can say it is in else part. But compiler will not accept
this.First it will compile everthing then running the SP. )

Its better to keep another name for Else part table.......

Is This Answer Correct ?    8 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If we delete pack Spec what will be the status of pack Body ?

1478


Explain the truncate command?

990


What are the different types of collation sensitivity in sql server?

1113


What is a scheduled job or what is a scheduled task?

952


what are defaults? Is there a column to which a default can't be bound? : Sql server database administration

1142


How much space does sql server 2016 take?

987


What is the bookmark lookup and rid lookup?

998


What is in place upgrade in sql server?

1047


What does top operator do?

1028


What is the command used to recompile the stored procedure at run time?

1083


How to define the name and server for a new dsn?

1124


How to use subqueries with the in operators in ms sql server?

1080


How many types of local tables are there in sql server?

934


How sql server enhances scalability of the database system?

1221


What are transactions in sql?

1069