Page 1 of 1

Need to delete Categories

Posted: Wed Jul 15, 2009 3:17 am
by JKstang
We had someone go into the Able admin and play around with creating new categories and then said person deleted them. (No it wasn't me)
Now I have a csv file nearly 25000 long that I've been working on for over a month to import..but when I attempted to upload the file, all the CategoryIDs (since the last upload) were off by several places due to Able keeping track of the deleted CategoryID numbers and skipping them when the file was imported. I have tried without success to resolve the issue.

Is there a simple way to blast out all the category info from the database and then use the csv file to upload all the correct data once more?
With the new info starting at row 0 as opposed to what ever the last known CategoryID row number was?

Please Help

Thanks in Advance

Re: Need to delete Categories

Posted: Wed Jul 15, 2009 3:00 pm
by JKstang
No one has any suggestions as to how to purge all the category info?

Re: Need to delete Categories

Posted: Wed Jul 15, 2009 3:35 pm
by jmestep
You could try deleting all the categories from the Admin and that would delete them from the category table and any related records, which is why you would want to do it that way- make sure everything gets cleared out.
Then do a test upload of a few from your spreadsheet and see it they retain the numbering you want.
If not, you could try turning the identity field off in the category table, uploading your file, then turning it back on so it will start incrementing as you add more later. You would have to have access to your SQL Server database to try that.

Re: Need to delete Categories

Posted: Thu Jul 16, 2009 1:21 pm
by JKstang
Ok...I did as suggested but it didnt work...and now the IDs are off by the 1000s.
Some how SQL2005 still seems to start the CategoryIDs at the next known number..as opposed to 1..and since I went into the admin and removed all the categories, and then tried to reload them via csv, that number is now somewhere around 19000.

I really dont want to wipe everything and start fresh, but unless someone has another idea, as to how I can blast out everything from the 4 Category tables..should I have just tried a truncate?

Re: Need to delete Categories

Posted: Thu Jul 16, 2009 1:32 pm
by heinscott
Did you try "SET IDENTITY_INSERT ac_Categories ON;" before inserting data? That should do the trick, I think. I had the same problem with my categories/product link when I first imported. Just make sure to insert the CategoryId as well in this case.

Scott

Re: Need to delete Categories

Posted: Thu Jul 16, 2009 3:16 pm
by JKstang
Needed to set the reseed to 0 before the import, that did it.