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 / madhu sudhan g
Hiiii
in Stored Procedures we cannot create same temp table twice if it is in IF else conditions also
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Does an index slow down updates on indexed columns?
How to create view in stored procedure sql server?
What is the difference between truncate and delete commands?
What command must you use to include the not null constraint after a table has already been created?
How do I start and stop sql server?
How can I check if a view exists in a sql server database?
Can binary strings be converted into numeric or float data types?
What is buffer cash in sql server?
Why we need sql server?
Explain steps of normalization?
Please explain that what are the basic functions for master, msdb, model, tempdb and resource databases? : SQL Server Architecture
Delete duplicate rows without using rowid.
How to execute a stored procedure in ms sql server?
what is sql server? : Sql server database administration
Mention the 3 ways to get a count of the number of records in a table.