Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BUG: sp and conditional temp table
Message
From
23/05/2005 11:45:06
 
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Miscellaneous
Thread ID:
01016662
Message ID:
01016785
Views:
11
>Fabio,
>
>I'm not exactly sure what you are calling a bug here, there's nothing conditional about the temp table itself, it will have to exist in the context of the calling SP for the code below to work at all.

David,

... it Will have to exist ????

With two different names the sp go into the db,
with the same name SQL fire a error:
CREATE	PROCEDURE dbo.test1
	@choice bit = 0
as
	if @choice=0
		SELECT 1 x INTO #TEMPTABLE
	else
		SELECT 0 x INTO #TEMPTABLE1
> But anyway this code compiles and executes without error:
>
>
>CREATE	PROCEDURE dbo.test1
>	@choice bit = 0
>as
>	if @choice=0
>		insert into #temptable SELECT 1 x
>	else
>		insert into #temptable SELECT 0 x
>
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform