VP-ASP :: Shopping Cart Software

Shopping Cart Software Solutions for anywhere in the World

US/Canada(Toll Free): +1 888 587 2278
Europe/UK: +44 (020) 7193 9408
Australia/New Zealand: +61 3 9016 4497

VP-ASP Shopping Cart Customer Forum

Home | Profile | Register | Active Topics | Members | Search | FAQ
Save Password
Forgot your Password?

 All Forums
 VPCart Forum
 General help me questions
 Order #s - Initializing at specific #
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

49 Posts

Posted - January 04 2007 :  15:51:22  Show Profile  Reply with Quote
How can we initialize our Order Numbers to start at a specific #? We would like to start with something like 51000, rather than 1, 2, 3, etc. We don't want customers to see that we've only had 3 or 5 or 7 orders to date. Thanks!

Using SQL Server05

Senior Member

United Kingdom
1898 Posts

Posted - January 04 2007 :  16:31:01  Show Profile  Visit devshb's Homepage  Reply with Quote
vpasp does have an "orderstart" file that comes with it, but if you're on sqlserver, you can do it directly by running a simple sql statement:

DBCC CHECKIDENT ( 'orders', RESEED, 51000 )

the help for that says.....(where "new_reseed_value" is 51000 from the above example).....
Current identity value is set to the new_reseed_value. If no rows have been inserted to the table since it was created, the first row inserted after you run DBCC CHECKIDENT uses new_reseed_value as the identity. Otherwise, the next row inserted uses new_reseed_value + the current increment value.

If the table is not empty, setting the identity value to a number less than the maximum value in the identity column can result in one of the following conditions:

* If a PRIMARY KEY or UNIQUE constraint exists on the identity column, error message 2627 will be generated on later insert operations into the table because the generated identity value will conflict with existing values.
* If a PRIMARY KEY or UNIQUE constraint does not exist, later insert operations will result in duplicate identity values.

if you want to find out what the current maximum id is, then run this in the advanced query admin screen:

select max(orderid) from orders

If you don't have access to the raw sqlserver database (eg via the host's sqlserver front-end, or enterprise manager), then our "advanced sql execution" (free) tool will let you run that DBCC statement via vpasp admin:


Simon Barnaby
[email protected]
Web Design, Online Marketing and VPASP addons

Edited by - devshb on January 04 2007 16:36:53
Go to Top of Page

Starting Member

49 Posts

Posted - January 09 2007 :  16:28:40  Show Profile  Reply with Quote
Thanks! Worked like a charm :)
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000