Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Indexing a temporary table
Message
De
23/02/2005 15:28:25
 
 
À
23/02/2005 14:38:45
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Divers
Thread ID:
00989789
Message ID:
00989820
Vues:
17
I have successfully indexed the #temp table, but how do I handle a select into the gigantic wms_ITRN_all view? Can I do a SELECT INTO #Tmp_ITRN and index that or will that be just as long to retreive that data. I can't change the wms_ITRN_all view but I can write a new one. This will be on tables and views on a remote server. How do I tell if the tables in the view have ANSI_NULLS on during the creation of the table?

Thanks
Jim


>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform