Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can't drop temp table
Message
From
30/03/2005 14:07:05
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00999810
Message ID:
01000031
Views:
21
If I do


SELECT *
INTO #TEST
FROM #ASTRA_BOOK_ALL

IF @@ROWCOUNT = 0

SELECT *
INTO #ASTRA_BOOK
FROM #ASTRA_BOOK_ONE

ELSE

SELECT *
INTO #ASTRA_BOOK
FROM #ASTRA_B00K_ALL


I have still declared #ASTRA_BOOK twice.

Thanks
Jim

















>>I was trying to make a complex program simple.
>>I made a view that Selected just the records I needed from
>>the huge transaction table. This made the joins to the smaller tables go much faster.
>>This is a warehouse program
>>The program is accessed by people or other programs. Nothing may be passed other than the customer code, optional parameters are start and end date,
>>book (part number) and type of transaction (Scrap, move, etc.)
>>
>>So to make it simple I was selecting into #ASTRA_All the view and all of the joins.
>>
>>I would then test for 'ALL', null, '', or '20961'
>>in the @BOOK variable.
>>
>>if 'ALL', null, or '' I would select the entire #ASTRA_ALL into #ASTRA_BOOK
>>Or if a specific part number I would Select the rows with that part number into #ASTRA_BOOK. But of course you can not do that.
>>
>
>See @@ROWCOUNT in BOL
Previous
Reply
Map
View

Click here to load this message in the networking platform