Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TOP 1 vs TOP 1 PERCENT
Message
De
04/03/2012 08:41:21
 
 
À
03/03/2012 12:47:43
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2008
Divers
Thread ID:
01537165
Message ID:
01537195
Vues:
37
>I have a complex view joining several tables
>I don't want the data, just a row that will give me the structure and allow me use the mapping to create a datatable in a dataset.
>
>I've been using this technique for zillions of views, but something about this view is odd and I got the following:
>
>
>When I run:
>SELECT TOP 1 * FROM myview
>the server times out.
>
>
>When I run:
>SELECT TOP 1 PERCENT * FROM myview
>I get a result in a few milliseconds.
>
>
>I tried ORDER BY 1 and got the same result
>
>So, of course I used TOP 1 PERCENT
>
>My question is.. does anyone know why there's such a difference between TOP 1 and TOP 1 PERCENT?
>
>Or, is the a better way to get the mapping into a datatable?
SELECT TOP 0 * FROM myview
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform