Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement