pathfinder8008
asked on
Change the productID of my entire Product table according to clients changing ranking
My web app presents an entire category of products displayed using (ORDER BY Product.ProductID). My client wants to choose which products are side by side and/or at the top of the page. To add a Rank column to my product table would force the client to manually assign an integer to each product in his catalog. I am thinking there is a way to change the ProductID to accommodate him instead. Some way of reordering the table. If anyone can help by either suggesting code or just tell me I am wasting my time, please do.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you shouldn't mess about with ID. The ID is there to uniquely identify each record, if you want to force an particular order then you would be better with a separate column to accomodate that.
ASKER
Thanks quizwedge, I added the Rank column and used (ORDER BY IsNull(Rank, 9999), Product.ProductID) to my SELECT ROW_NUMBER() and it works great. This solution will not over tax my client. And yes, carl tawn you are absolutely correct about messing with the uniqueID. It was clutching at straws. Thanks again to the pros at EE.