Need to delete Categories

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
JKstang
Ensign (ENS)
Ensign (ENS)
Posts: 13
Joined: Tue Feb 17, 2009 3:17 pm

Need to delete Categories

Post by JKstang » Wed Jul 15, 2009 3:17 am

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

JKstang
Ensign (ENS)
Ensign (ENS)
Posts: 13
Joined: Tue Feb 17, 2009 3:17 pm

Re: Need to delete Categories

Post by JKstang » Wed Jul 15, 2009 3:00 pm

No one has any suggestions as to how to purge all the category info?

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Need to delete Categories

Post by jmestep » Wed Jul 15, 2009 3:35 pm

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.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

JKstang
Ensign (ENS)
Ensign (ENS)
Posts: 13
Joined: Tue Feb 17, 2009 3:17 pm

Re: Need to delete Categories

Post by JKstang » Thu Jul 16, 2009 1:21 pm

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?

User avatar
heinscott
Captain (CAPT)
Captain (CAPT)
Posts: 375
Joined: Thu May 01, 2008 12:37 pm

Re: Need to delete Categories

Post by heinscott » Thu Jul 16, 2009 1:32 pm

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

JKstang
Ensign (ENS)
Ensign (ENS)
Posts: 13
Joined: Tue Feb 17, 2009 3:17 pm

Re: Need to delete Categories

Post by JKstang » Thu Jul 16, 2009 3:16 pm

Needed to set the reseed to 0 before the import, that did it.

Post Reply