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
What methods do you follow to protect from sql injection attack?
Are there any preferred steps that need to be taken care of before starting the installation of sql server 2000?
How to write character string constants or literals in ms sql server?
You have several tables, and they are joined together for querying. The tables contain both clustered indexes and non clustered indexes to optimize performance, how should you distribute the tables and their indexes onto different file groups?
How to find the source of a table in sql server?
What new changes are being made in SQL Server?
How are the exceptions handled in sql server programming?
Can we join two tables without primary key?
What is mean by dml?
Suppose we have a table "MyTable" containing 10 rows, what query should be executed to update the odd rows "Salary" as 9000?
Are there issues when exporting SSRS reports into Microsoft Excel? When my users are trying to export a SSRS report into Microsoft Excel, one or two columns in the report appear to merge together. Why might this be?
Is it possible to call a stored procedure within a stored procedure?
What are magic tables in sql server?
How check triggers in sql server?
Does index speed up select statements?