Are you sure? I work with MSSQL and everytime a SP is created like this:
[quote]
create procedure sm110112127120
(@ChainID varchar(20), @ChainN varchar(20), @InsRecordId varchar(20) OUTPUT, @MaxChainId varchar(20) OUTPUT, @MaxChainN varchar(20) OUTPUT)
AS
BEGIN
declare @recid int
declare @chid int
declare @chn int
select @MaxChainId = '-1'
select @MaxChainN = '-1'
select @InsRecordId = '0'
select @chid = convert (numeric, @ChainID)
select @chn = convert (numeric, @ChainN)
insert into maxlistid select 'ib3' as tablename,max(record_id),max(chain_id) from ib3
IF @chid > 0 AND @chn > 0
BEGIN
select @recid = (select count(*) from ib3 where chain_id = @chid AND chain_n = @chn)
IF @recid > 0
RETURN
BEGIN TRANSACTION
select @recid = max(maxrecid) from maxlistid where tablename='ib3'
select @recid = isnull(@recid, 0)+1
insert into maxlistid (tablename,maxrecid,maxchainid) values('ib3',@recid,@chid)
COMMIT TRANSACTION
delete from maxlistid where maxrecid < @recid AND maxchainid < @chid AND tablename='ib3'
select @InsRecordId = convert (varchar(20), @recid)
select @MaxChainId = convert (varchar(20), @chid)
select @MaxChainN = convert (varchar(20), @chn)
RETURN
END
IF @chid > 0
BEGIN
select @recid = (select count(*) from ib3 where chain_id = @chid)
IF @recid > 0
BEGIN
select @chn = max(chain_n) from ib3 where chain_id = @chid
select @chn = isnull(@chn, 0)+1
IF @chn < 0
select @chn = 0
END
ELSE
select @chn = 0
BEGIN TRANSACTION
select @recid = max(maxrecid) from maxlistid where tablename='ib3'
select @recid = isnull(@recid, 0)+1
insert into maxlistid (tablename,maxrecid,maxchainid) values('ib3',@recid,@chid)
COMMIT TRANSACTION
delete from maxlistid where maxrecid < @recid AND maxchainid < @chid AND tablename='ib3'
select @InsRecordId = convert (varchar(20), @recid)
select @MaxChainId = convert (varchar(20), @chid)
select @MaxChainN = convert (varchar(20), @chn)
RETURN
END
BEGIN TRANSACTION
select @chid = max(maxchainid), @recid = max(maxrecid) from maxlistid where tablename='ib3'
select @chid = isnull (@chid, 0)+1
select @recid = isnull (@recid, 0)+1
insert into maxlistid (tablename,maxrecid,maxchainid) values('ib3',@recid,@chid)
COMMIT TRANSACTION
delete from maxlistid where maxrecid < @recid AND maxchainid < @chid AND tablename='ib3'
select @InsRecordId = convert (varchar(20), @recid)
select @MaxChainId = convert (varchar(20), @chid)
select @MaxChainN = '0'
END
GO
[/quote]
Where ib3 is the table name for my calling list. Even if you check OCS logs you will see that it executes the SP frequently.