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 the beast way to write CTE in SQL Server ?

1045


How to find index size for each index on table?

1003


What are the advantages of passing name-value pairs as parameters?

1168


what is the difference between writing data to mirrored drives versus raid5 drives. : Sql server administration

967


How can we determine what objects a user-defined function depends upon?

1014


What are approximate numeric data types in ms sql server?

1059


Which joins are sql server default?

1013


What is sql server transaction log file?

1057


What is the order in which the sql query is executed?

942


What is user defined stored procedures?

946


If you are given access to a SQL Server, how do you find if the SQL Instance is a named instance or a default instance?

1108


Explain how you can deploy an SSRS report?

150


Define the one-to-one relationship while designing tables.

903


What should be the fill factor for indexes created on tables? : sql server database administration

1138


How to make a column nullable?

1115