Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Generating Auto Invoice Numbers -SqlServer 2008

Author  Topic 

paramu
Posting Yak Master

151 Posts

Posted - 2010-02-12 : 10:00:37
I have a table InvoiceMaster table. And the table datas are available like the following manner

Invoice_No,Invoice_date,Customer_code,Qty,unit_rate,Item_Amount
10, 12/02/2010, abc1, 10, 15.00, 150.00
10, 12/02/2010, abc2, 11, 10.00, 110.00
11, 12/02/2010, abc3, 10, 15.00, 150.00
11, 12/02/2010, abc2, 11, 10.00, 110.00
11, 12/02/2010, abc4, 14, 10.00, 140.00

like wise...

Now the problem is , while using in multiuser [LAN] network, while saving time how to allocate the different Invoice number
for various user.

Does sqlserver2008 has that facility?

Thanks For The Ideas

Paramu @ PARANTHAMAN

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-02-12 : 10:03:45
whats the pk of table now?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-02-12 : 10:16:59
You can use IDENTITY - but that will NOT give you contiguous numbers -i.e. there will be some gaps [when a transaction is rolled back] - which accounts tell me is important because it allows fraud

Next up is a table with one row that has "next invoice number" and you use that, and increment it, as invoices are inserted.
Go to Top of Page

paramu
Posting Yak Master

151 Posts

Posted - 2010-02-13 : 01:08:33
Thanks to Visakh & Kristen...



Paramu @ PARANTHAMAN
Go to Top of Page
   

- Advertisement -