Re: [Emerald] highest invoice #

Dale E. Reed Jr. ( (no email) )
Sat, 26 Jun 1999 18:45:44 -0700

Ben Conner wrote:
>
> At 05:53 PM 6/26/99 -0700, you wrote:
> >The Invoiecs table contains the identity value, which is want you are
> >looking for. What you have to do is:
> >
> >-------------------
> >SET INDENTITY_INSERT Invoices On
> >
> >Insert Into Invoices(InvoiceID, ...)
> >VALUES(xxx, ....)
> >
> >SET INDENTITY_INSERT Invoices Off
> >
> >Delete From Invoices Where InvoiceID = xxx
> >-------------------
> >
> >You have to fill in the rest of the fields on the Invoices table. :)
>
> Um, if what I'm reading is correct, I need to insert however many invoices
> into the invoice table to push it to the # I need? For example, say the
> highest current invoice is 1500; I want to start at 3,000. Do I just do
> one insert with invoiceid of 3000, or do I need to generate 1500 insert
> commands? (I sure hope you don't pick Door B. :) )

You need to insert one with the value one less than where you one
to start with. SQL Server will reset the counter to that value,
if its higher than the current seed.

-- 

Dale E. Reed Jr. Emerald and RadiusNT__________________________________________IEA Software, Inc. www.iea-software.com