smigl Posted December 27, 2011 Share Posted December 27, 2011 Hi, i have an idea how to update my product prices faster directly using Query then manual opening 1by1 item in my admin page. but here is problem... I need to update multiple items with diffrent values. here is how table looks like SELECT TOP 1000 [id] ,[name] ,[itemno] ,[description] ,[smallimage] ,[largeimage] ,[price] ,[shortdesc] ,[active] ,[feature] ,[saleprice] ,[onsale] ,[search] ,[qty] ,[addqty] ,[imgresize] ,[hideprice] ,[hidehead] ,[weight] ,[digital] ,[digfile] ,[pgvisits] ,[pgvisitson] ,[taxable] ,[custom1] ,[custom2] ,[custom3] ,[imgwrap] ,[shipping] FROM [YRHR_PD_SHOP].[dbo].[items] now i want to change price and saleprice of items linkin it to itemno here is what i did to change 1 data UPDATE dbo.itemsSET price='10.20', saleprice='9.90', onsale='YES'WHERE itemno='68418' now how do i do it for multiple data, problem is that itemno, price and saleprace are all diffrent for every entry.for example UPDATE dbo.itemsSET price='10.20', saleprice='9.90', onsale='YES'WHERE itemno='68418';SET price='109.20', saleprice='67.90', onsale='YES'WHERE itemno='24507';SET price='156.20', saleprice='23.90', onsale='YES'WHERE itemno='22567' can anybody help? thank you. Link to comment Share on other sites More sharing options...
smigl Posted December 27, 2011 Author Share Posted December 27, 2011 well this worked... stupid me UPDATE dbo.itemsSET price='10.20', saleprice='9.90', onsale='Yes'WHERE itemno='68418'UPDATE dbo.itemsSET price='99.90', saleprice='65.90', onsale='Yes'WHERE itemno='24507' is there any better solutio? Link to comment Share on other sites More sharing options...
justsomeguy Posted January 3, 2012 Share Posted January 3, 2012 That's the way to do it. If you're running this on SQL Server you can separate the queries with semicolons and send the batch to the server at once. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.