_覓 | 覦覈襦 | 豕蠏手 | 殊螳 | 譯殊碁 |
FrontPage › MS-SQLOracleSequence磯狩蠍
|
|
[edit]
2 #use tempdb go --豐蠍一誤 create table dbo.Sequence(seq int) insert dbo.Sequence values(1) go create proc dbo.usp_Sequence @option tinyint --1:currval, 2:nextval, , @increment int = 1 as declare @seq int; if @option = 2 begin update dbo.Sequence set @seq = seq = seq + @increment; end else set @seq = (select top 1 seq from dbo.Sequence); return @seq; go --: 螳 declare @seq int exec @seq = dbo.usp_Sequence 1 select @seq --: れ螳 declare @seq int exec @seq = dbo.usp_Sequence 2 select @seq
鏤
|
企ゼ れ蟆 觜蟲讌 蠍 (れ) |