Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Fred Prose wrote in message
<44C2247EAFF4D011B0BD00805F85B09C0C0526B8@news.maricopa.gov>...
>What is the prevailing thought about using BEGIN/COMMIT WORK within a
Stored
>Procedure?
>
How do you know the procedure isn't already within a BEGIN/COMMIT WORK ?
I see here many opportunities for big mistakes.
>I've got a SP which is called to obtain and increment a "next serial
number"
>column. This potentially will cause a bottle nexk and I'd like to have the
>SP "get in and get out" ASAP.
>
>Any other suggestions to make sure the SP isn't doing any dirty reads?
>
1. make the "serial" a unique column and test for duplicate inserts.
Good for table with few changes, bad for busy tables.
2. As suggested in another thread, create another table with only a serial
column,
insert a new row and get the inserted serial.
Only works if the serial is the only field in the key and not the last
field of a logical key.
>Thanks,
>
>
>
C.
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.