Author |
Topic |
|
aaronrand
Starting Member
2 Posts |
Posted - November 19 2008 : 16:33:18
|
looking to change catalogid numbers, i tried advanced edit but it seems locked in. i am trying to fix the first few tests i entered but now i am off track from catalogid and product code. so can i edit catalogid? |
|
g3nnin
VP-CART Super User
209 Posts |
|
aaronrand
Starting Member
2 Posts |
Posted - November 20 2008 : 13:29:12
|
thanks but not quite what i was looking for. i want to reset certain ones, not all if possible |
|
|
cierra1
Starting Member
USA
6 Posts |
Posted - November 21 2008 : 10:48:38
|
Generally you can not change the catalogid. This is an automatically generated sequential number, plus it is not a good idea to do so because for products there are many entries tied to this number. If you must, you will need to go into design view of the table in Access you want to change, you will see the id field is set to Autonumber, change it to number. Save and then go back to the datasheet View. Change the number to what you need. Then go back to the design view and reset to Autonumber. You will then need to go through the rest of your product tables and change the id number to the new one you've set so everything matches again. But it would be better to delete these products, or mark them as inactive and create new ones with the correct information.
If you are using SQL the process is a little different but same idea, the steps will vary depending on what version of SQL you are using. Basically, you will need to go into the table and turn off the identity on the field and the index key, save, then change your numbers. When you are done, go back in and reset the ID to the identity and the key and you should be good to go |
|
|
Phineas
Starting Member
1 Posts |
Posted - January 14 2009 : 19:44:47
|
I am trying to reset the catalogid field in the products table back to zero. All products have been deleted and I wish the first imported product to get a value of 1. What is the SQL procedure... I don't see how to turn off the read only setting and I can't get the ID's to synchronise with subcatagories. I don't understand where to turn off "identity". It would be much simpler if this field could be set to "editable". |
|
|
devshb
Senior Member
United Kingdom
1904 Posts |
Posted - January 15 2009 : 05:01:57
|
on sqlserver you could try the "reseed" option, eg:
http://vpasp.com/virtprog/vpaspforum/topic.asp?TOPIC_ID=6312
example in this instance would be:
DBCC CHECKIDENT ( 'products', RESEED,1)
but that's a fairly dangerous thing to do for products because you need to ensure there's no associated records left for any products in any tables (there might be orphans in prodcategories for example which you can't see from the normal admin processes)
I guess the main question before you do reseeding or temporarily turning off the ident is what's the reason behind resetting the numbers? I think that's the question that should really be getting debated here (is it because links to shopexd.asp?id=x shouldn't ever change for a given product following a deletion/re-import?)
Remember that the catalogid field is purely an internal identifier; it's not a real product value as such, so you'd normally expect gaps in it, and you'd expect it not to relate to any specific sorting/ordering in the data. Also the admin edit-products page/processes all assume that catalogid is auto-populated via an ident, so turning off the ident would stop it from being populated with unique values.
Simon Barnaby Developer [email protected] www.BigYellowZone.com Web Design, Online Marketing and VPASP addons |
Edited by - devshb on January 15 2009 05:13:48 |
|
|
|
Topic |
|