I have a product details page that user goes to when he wants more information about an individual product.
The url looks something like this. www.mywebsite.com?product.asp?ID=2
and my store procedure looks something like this:
ALTER PROCEDURE [my].[sp_details]
@ID varchar (255)
SELECT LINK_ID, CAT_ID, LINK_NAME
WHERE LINK_ID = @ID
On the same page I want to call up 10 similar products that have the same "CAT_ID" as the product being displayed.
I tried added the below SP but I'm not getting the results I need.
ALTER PROCEDURE [my].[sp_RandombyCat]
@ID varchar (255),
SELECT TOP 10 LINK_ID, LINK_NAME, CAT_ID
WHERE LINK_ID = @ID AND CAT_ID LIKE '%'+@MMColParam+'%'
ORDER BY NEWID()
I work with: Classic ASP VB, SQL 2005, SQL Server Express, DreamweaverCS3, newbie to SQL