Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TOP cannot be a parameter
Message
De
30/05/2007 14:28:48
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Titre:
TOP cannot be a parameter
Versions des environnements
SQL Server:
SQL Server 2000
Divers
Thread ID:
01229408
Message ID:
01229408
Vues:
49
This code produces an error in QA due to the parameter for the TOP value.
create procedure invpage
@SearchString VarChar(50),
@PageSize Integer,
@PageNo Integer
as 
set @pagesize = 10
set @SearchString = 'Beer'

SELECT top @PageSize inv.uid, inv.isbn13, inv.sku1, inv.description, inv.listprice, inv.webprice, inv.datepub, inv.edition, inv.pages, inv.oop, inv.binding, inv.idsect, 
      Annotation.annotation, author.fullname, COVERART.JFILENAME, COVERART.TFILENAME, inv.uidclient
FROM inv LEFT OUTER JOIN
     Annotation ON inv.isbn13 = Annotation.isbn13 LEFT OUTER JOIN
     author ON inv.uidAuthor = author.uid LEFT OUTER JOIN
                         COVERART ON inv.isbn13 = COVERART.ISBN13
WHERE (inv.uidclient = 2) AND CONTAINS(inv.description, @SearchString)
Any Ideas?

Glenn
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform