![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
HI All, I have got struck in a situation where 2 or more processes appear simultaneously read the data from a table and each one of them insert a new row into the same table. The table has column, similar to an identity. The query gets the max of the column adds one to it and then inserts it. When parallel quering is happening then the column will have an non unique values which is not expected. Please note that, there is already a unique clustered index on some other column and identity column cannot be used in this scenario. So i was looking for some support from sybase where i can allow only one select operation at one time, gets the new value by adding one and then inserting it into the table. Then allow others one by one in a queue. By doing this it will sure that there are no duplicate values in the column. Please let me know is there any way of achieving this. BR.// -Zia |
#3
| |||
| |||
|
|
HI All, I have got struck in a situation where 2 or more processes appear simultaneously read the data from a table and each one of them insert a new row into the same table. |
#4
| |||
| |||
|
|
Have a look at "isolation level" in the SQL Utility Guide. By default, it is set to 1, you should launch your stored procedure with the level 3 (SQL92 default) to meet your needs. BR, Laurent |
#5
| |||
| |||
|
|
HI All, I have got struck in a situation where 2 or more processes appear simultaneously read the data from a table and each one of them insert a new row into the same table. The table has column, similar to an identity. The query gets the max of the column adds one to it and then inserts it. When parallel quering is happening then the column will have an non unique values which is not expected. Please note that, there is already a unique clustered index on some other column and identity column cannot be used in this scenario. So i was looking for some support from sybase where i can allow only one select operation at one time, gets the new value by adding one and then inserting it into the table. Then allow others one by one in a queue. By doing this it will sure that there are no duplicate values in the column. Please let me know is there any way of achieving this. BR.// -Zia |
#6
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |