globalstrata
MIS
Hello,
I am trying to create a store procedure that display random items using SQL 2005 and the below code but it tells me: Incorrect syntax near '@RecordAmount'. Can any one tell me what am I doing wrong?
Code:
CREATE PROCEDURE dbo.sp_GetRandomProduct
@CatID int,
@RecordAmount int
AS
SELECT TOP @RecordAmount dbo.Product.ProductID
FROM dbo.Product
ORDER BY NEWID()
RETURN
Thanks in advanced,
Gladys Rodriguez
GlobalStrata Solutions
Computer Repair, Website Design and Computer Consultant
Small Business Resources