Soter Procedure 2

  • Thread starter Thread starter Dib
  • Start date Start date
D

Dib

Hi,

I have an sql in a stored procedure but I am getting an erro.

@NumOfCust int --Parameter


Declare @NumOfCustomer int

SELECT @NumOfCustomer = @NumOfCust





SELECT Top @NumOfCustomer t.SumOfSales, t.CustId, C.CustName, C.Contact,
C.Addr1, C.Addr2, C.City



But I am getting a syntex error for @NumOfCustomer . If I remove
@NumOfCustomer and add 50 it works





What am i doing wrong



Thanks

Dib
 
Under SQL-Server 2000, you cannot use a variable as the value for a TOP
instruction.

Use SET ROWCOUNT @NumOfCustomer instead.

S. L.
 
Back
Top