Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A very unique situation
Message
De
04/02/2014 14:21:24
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2008
Application:
Web
Divers
Thread ID:
01593091
Message ID:
01593198
Vues:
23
>I think you need to say where Numero IN (select Numero from #Temp)

It works in both ways. This is because #Temp only contains one field. But, for standardization, I have added Temp.Numero.
SELECT Numero INTO #Temp FROM Country WHERE Numero<10
SELECT * FROM Country WHERE Numero IN (SELECT #Temp.Numero FROM #Temp)
>Now, it may perform better for complex scenarios (e.g. selecting keys only into temp table first and then all info for these keys). In simple cases it may not give performance gain or may even be slower than original direct query without using a temp table.

Yes, I have applied a verification to detect which route to take. If the table has less than 1000 records, it goes as before. If it has more, it will use this approach.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform