Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TOP cannot be a parameter
Message
De
30/05/2007 14:35:05
 
 
À
30/05/2007 14:28:48
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Versions des environnements
SQL Server:
SQL Server 2000
Divers
Thread ID:
01229408
Message ID:
01229413
Vues:
8
Hi, Glenn,

Prior to SQL '05, TOP N cannot be a variable. You'll need to use dynamic SQL....OR...you can set the @ROWCOUNT value and then set it back after the query. Check @RowCount in books on line for details.

In SQL '05, TOP N can now be a true variable....you can do

SELECT top (@PageSize)

Hope that helps...
Kevin
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform