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 / lee
yep problem is with the compiler.. I had to think of
another way to solve the problem, eg, I created the #temp
without the IF statement and then used an IF ELSE statement
to modify or update #temp, make sense?
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Explain user defined functions?
What do you understand by physical_only option in dbcc checkdb?
Explain the use of keyword with encryption. Create a store procedure with encryption?
What is the boxing and unboxing concept in .net?
Is truncate autocommit?
hi, the following are the outputs of sp_spaceused and sp_tempdbspace sp_spaceused ------------ database size unallocated size tempdb 77752.95 MB 28026.99 MB sp_tempdbspace ------------- database size spaceused tempdb 77752.945312 1.007812 the unused space in sp_spaceused is nearly 28 Gb and in sp_tempdbspace is nearly 76 Gb cany any one explain about this output and why its giving different results.
What are the filtered indexes?
What are the types of database recovery models?
I have a table Events Events containing cardno,time,id,name--each id has a cardno my requirement is every day each employee swipe the card several times i want to calculate first and last time of each card the output should be name 1 2 6 7 in out in out holiday holiday xxx 09:30 06:30 09:40 06:45 where 1,2...... are dates for example january 1,2, etc. 6 and 7 are saturday and sunday how it is posssible
Hi all, can any one please tell me the difference between sql server 2008 and orace 9i
How to insert data with null values?
How to add the custom code in Report?
What do you understand by triggers?
How do clustered indexes store data?
How to create a view using data from another view?