Welcome, Guest ( Customer Panel | Login )




 All Forums
 VPCart Forum
 General help me questions
 catalogid Number Start?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Peter
VP-CART New User

125 Posts

Posted - January 21 2007 :  18:33:40  Show Profile  Reply with Quote
I have used the Order Number Start utility to boost my initial order number.

Can anyone suggest the best way to achieve a similar result for the catalogid in the products table? I am using version 6 and MSSQL.

I would like to use the catalogid as my product 'code', but want them to be in a similar number format. Starting at a higher number would solve this - eg: 100001, 100002, 100003 and so on.




Edited by - Peter on January 21 2007 18:35:30

Kidd
VP-CART Super User

Australia
373 Posts

Posted - January 21 2007 :  21:44:08  Show Profile  Reply with Quote
modify the sql scrip you got from order number, i dont have it because i dont use that thing, but i believe there will be something saying orders table, modify that to products and run the script

it will do whatever changes it made to your orders table on your products...t
Go to Top of Page

Peter
VP-CART New User

125 Posts

Posted - January 21 2007 :  23:05:37  Show Profile  Reply with Quote
Thanks.

I have just tried to do this without much success. Can you see anything wrong with this code?



sqlo="insert into products (catalogid,cname,cdescription,cprice,ccategory) "
sqlo=sqlo & " Values(" & Ordernumberstart-1 & ",'DUMMY','DUMMY',1,1)"



I pulled the following error out of the log:



|16|80040e14|[Microsoft][ODBC_SQL_Server_Driver][SQL_Server]Cannot_insert_explicit_value_for_identity_column_in_table_'products'_when_IDENTITY_INSERT_is_set_to_OFF.

Go to Top of Page

Kidd
VP-CART Super User

Australia
373 Posts

Posted - January 22 2007 :  05:50:11  Show Profile  Reply with Quote
set identity_insert prodcuts on try add this

or if thats the scrip just do a simple inser

sqlo="insert into products(catalogid) values (100000)

your next catalog id will be 100001
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000
0 Item(s)
$0.00