Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Indexing a temporary table
Message
From
23/02/2005 14:38:45
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Title:
Indexing a temporary table
Miscellaneous
Thread ID:
00989789
Message ID:
00989789
Views:
43
I was having trouble getting results from a stored procedure that had a left outer join with a view of the transaction table from Baltimore. I ask one of the programmers what the problem was and he said the transaction table is incredible large and growing larger every second.

He said to get all of the join information from the local table inventory into a temporary table, which I should index. Here is my feeble atempt.

What did I do wrong. What suggestions do you have?

SELECT
i.primary_reference
,i.short_desc

INTO #temp

CREATE INDEX [InInventory]

ON [dbo].[#temp]([primary_reference])

WITH FILLFACTOR = 100 ON [PRIMARY]

FROM inventory i


Here is the original join

vw_SMPaper_Orders_LineItem_Inventory smp with (nolock)
LEFT OUTER JOIN wms_ITRN_all r with (nolock) ON smp.lineitem_primary_reference = r.sku

wms_INTRN_All is the view of the big table.


Thanks
Jim
Next
Reply
Map
View

Click here to load this message in the networking platform