----------------------------------------------------------- New Message on BDOTNET
----------------------------------------------------------- From: ssv_2000 Message 1 in Discussion Hi All, Thanks to everyone participating in this group. I am working on a WebApplication with SQL Server 2000 as backend. There are a few columns in some tables that need their value to be autoincremented. But these columns have some kind of a pre-key...I mean, the product Id is to be autogenerated as a running incremental value but within a Product Category, Order No is a running number but within a RegionId... ex: ProductCtg ProductId (field to be autogenerated) --------------- ------------- ProductCtg1 1 ProductCtg1 2 ProductCtg1 3 ProductCtg1 4 ProductCtg2 1 ProductCtg2 2 ProductCtg2 3 ... and so on. Because of the pre-key, I guess, SQL Servers autoincrement feature wouldnt do it. Considering autogenerating in triggers or stored procedure just before insert, with a select max() query to get the last value in that category, & do a +1 and insert, the select max() query seems to be an expensive Query when executed within a transaction. The Inserts of Orders and Order Details are done within a begin, commit transaction block. There will be several users submitting bunches of orders at the same time. This query will block a user until the other one comits his whole set of records. (Missing of numbers inbetween if a user issues a rollback is acceptable). Has anyone come across such cases? What are the best ways of implementing this? Thanks again. SriVidya. ----------------------------------------------------------- To stop getting this e-mail, or change how often it arrives, go to your E-mail Settings. http://groups.msn.com/bdotnet/_emailsettings.msnw Need help? If you've forgotten your password, please go to Passport Member Services. http://groups.msn.com/_passportredir.msnw?ppmprop=help For other questions or feedback, go to our Contact Us page. http://groups.msn.com/contact If you do not want to receive future e-mail from this MSN group, or if you received this message by mistake, please click the "Remove" link below. On the pre-addressed e-mail message that opens, simply click "Send". Your e-mail address will be deleted from this group's mailing list. mailto:[EMAIL PROTECTED]
