Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Yet another SQL Question
Message
From
29/09/2012 03:55:58
 
 
To
28/09/2012 16:44:31
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2008
Miscellaneous
Thread ID:
01553897
Message ID:
01553929
Views:
58
>Hi all
>
>I want to crate a temp table based on a value passed to a stored procedure. Basically I'm trying to do this:
>
>If (some critera)
>  select (field list) into #SubFile from CATMaster where (otherstuff)
>else
>  Select (field list) into #SubFile from CatMaster where (otherstuff, slightly different from the first)
>
>
>It's giving me the red squiglly line under the 2nd #Subfile and telling me that one already exists in DB.
>
>What is the correct way to do what I want to do in SQL?

it is a SQL SERVER bug.

try this code with and without GO commented.
SELECT x = 1 INTO #T1
DROP TABLE #T1
--GO
SELECT x = 2 INTO #T1
Previous
Reply
Map
View

Click here to load this message in the networking platform