Z
Zinn
Guest
I have this:
This gives me a syntax error when I have the "TOP @NumAds ID" in there. when I use "TOP 5 ID" the procedure works. I've tried casting @NumAds as a variety of different data-types, and none has worked. I really need to pass in this parameter, so what can I do?
Thanks in advance.
Code:
CREATE PROCEDURE GetAds
@NumAds numeric = 1
AS
SELECT TOP @NumAds ID
FROM Ads
GO
Thanks in advance.