Soter Procedure 2

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
 
S

Sylvain Lafontaine

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

Use SET ROWCOUNT @NumOfCustomer instead.

S. L.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top