multi-threading batch updates, how to get unique identifiers
来源:互联网 发布:unity3d性能分析器 编辑:程序博客网 时间:2024/06/15 20:40
create procedure My_unique
(
@table_id int,
@incr int,
@unique int output
)
as
/*
* %W% %D%
* Get a block of incr unique id's for table with ID table_id.
* Returns first ID in the block.
*/
select @unique = -999
if @incr < 1
begin
select error_status = "Must set increment > 0"
return @unique
end
if @table_id = 103
begin
begin transaction
update tradeControl
set tradeId = tradeId + @incr
select @unique = tradeId - @incr
from tradeControl
commit transaction
return @unique
end
else if @table_id = 100
begin
begin transaction
update STPIdCtrl
set id = id + @incr
where STPFieldName = 'eventId'
select @unique = id - @incr
from STPIdCtrl
where STPFieldName = 'eventId'
commit transaction
ret
urn @unique
end
else if @table_id = 101
begin
begin transaction
update STPIdCtrl
set id = id + @incr
where STPFieldName = 'ticketId'
select @unique = id - @incr
from STPIdCtrl
where STPFieldName = 'ticketId'
commit transaction
retu
rn @unique
end
else if @table_id = 104
begin
begin transaction
update STPIdCtrl
set id = id + @incr
where STPFieldName = 'updateId'
select @unique = id - @incr
from STPIdCtrl
where STPFieldName = 'updateId'
commit transaction
retur
n @unique
end
else if @table_id = 110
begin
begin transaction
update TDSIdCtl
set updateId = updateId + @incr
select @unique = updateId
from TDSIdCtl
commit transaction
return @unique
end
else if @table_id = 14
begin
begin transaction
select @uniq
ue = ord_grouping_id
from CDM_ord_groupings_ctrl holdlock
update CDM_ord_groupings_ctrl
set ord_grouping_id = ord_grouping_id + @incr
commit transaction
end
else if @table_id = 27
begin
begin transaction
select @unique = order_id
from CDM_order_ctrl holdlock
update CDM_order_ctrl
set order_id = order_id + @incr
commit transaction
end
else if @table_id = 28
begin
begin transaction
select @unique = execution_id
from CDM_execution_ctrl holdlock
update
CDM_execution_ctrl
set execution_id = execution_id + @incr
commit transaction
end
else if @table_id = 26
begin
begin transaction
update CDM_position_ctrl
set position_id = position_id + @incr
select @unique = position_id - @incr
from CDM_position_ctrl
commit transaction
end
else if @table_id = 18
begin
select @unique = volatility_id
from CDM_volatility_ctrl holdlock
update CDM_volatility_ctrl
set volatility_id = volatility_id + @incr
end
else if @table
_id = 20
begin
begin transaction
update CDM_yield_ctrl
set yield_id = yield_id + @incr
select @unique = yield_id - @incr
from CDM_yield_ctrl
commit transaction
end
else if @table_id = 22
begin
begin transaction
update CDM_divide
nd_ctrl
set dividend_id = dividend_id + @incr
select @unique = dividend_id - @incr
from CDM_dividend_ctrl
commit transaction
end
else if @table_id = 29
begin
begin transaction
update CDM_underlying_ctrl
set underlying_id = u
nderlying_id + @incr
select @unique = underlying_id - @incr
from CDM_underlying_ctrl
commit transaction
end
else if @table_id = 19 or @table_id = 102
begin
begin transaction
update CDM_yield_list_ctrl
set yield_list_id = yield_list_
id + @incr
select @unique = yield_list_id - @incr
from CDM_yield_list_ctrl
commit transaction
end
else if @table_id = 21
begin
begin transaction
update CDM_dividend_list_ctrl
set dividend_list_id = dividend_list_id + @incr
selec
t @unique = dividend_list_id - @incr
from CDM_dividend_list_ctrl
commit transaction
end
else if @table_id = 95
begin
begin transaction
update CDM_borrow_detail_ctrl
set borr_id = borr_id + @incr
select @unique = borr_id - @incr
from CDM_borrow_detail_ctrl
commit transaction
end
else if @table_id = 96
begin
begin transaction
update CDM_borrow_list_ctrl
set borr_list_id = borr_list_id + @incr
select @unique = borr_list_id - @incr
from CDM_borrow_list_ctrl
commit transaction
end
else if @table_id = 55
begin
select @unique = execution_log_id
from CDM_execution_log_ctrl holdlock
update CDM_execution_log_ctrl
set execution_log_id = execution_log_id + @incr
end
else if @table_id = 58
beg
in
select @unique = reut_mask_id
from CDM_reuters_masks_ctrl holdlock
update CDM_reuters_masks_ctrl
set reut_mask_id = reut_mask_id + @incr
end
return @unique
- multi-threading batch updates, how to get unique identifiers
- Multi-Threading: How to Create Threads in UE4
- Multi-Threading: How to Create Threads in UE4
- How to get a global unique hardware ID
- How to get unique visitors per page on Google Analytics?
- Failed to Match * of * Components using Unique Identifiers
- Multi-threading
- Updates are currently disallowed on GET requests. To allow updates on a GET, set the 'AllowUnsafeUp
- How to Enable Multi-Touch
- Stream Unique Identifiers
- How to do the trade after new updates?
- How to disable automatic updates on Fedora 25?
- how to get?
- How to Get Insights?
- how to get gril
- how to get UDID
- 多线程入门(Time to step into multi-threading)
- How to custom Spring Batch DelimitedLineTokenizer?
- http://home.blueidea.com/apps.php?do=bxna&ac=view&feedid=12443
- Cursor-Position&Trade
- Iteration operation to records in temp table
- 1day _jsp
- 非常好的python学习资料
- multi-threading batch updates, how to get unique identifiers
- delphi得到MAC地址
- Testbench::Run
- MVC3集成Unity 2.0
- [Sybase] Foreigh Key/Index column
- 哪些虚拟机支持Windows 8?微软为你总结
- How to resolve '_DllMain@12 already defined in xxx.obj' ?
- GRE词汇竟然六小时背一遍
- java 虚拟机的内存限制