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
What is raid? : SQL Server Architecture
What is the minimum and maximum number of partitions required for a measure group? : sql server analysis services, ssas
What are sub reports?
What are different types of database indexes?
SQL Server Architecture ?
Is it possible to update the views? If yes, how, if not, why?
How do I create a trace in sql server?
How to create sub reports?
When columns are added to existing tables, what do they initially contain?
What are two difference between sql azure and azure tables?
Do you know data definition language, data control language and data manipulation language?
Is there any difference between primary key and unique with the not null condition?
How can a user-defined datatype be created?
What are the types of containers in ssis?
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?