I have this stored procedure that works well in SQL2005 bu get errors when trying to create it in Sybase. I could really need some help.
Basically all it does is lock the table while getting the single row of data for a ConsumerID number and adds one for return then unlocks ready for the next execution.
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
ALTER PROCEDURE [dbo].[get_consumerID] @outvar char(9) output
declare @ConsumerID as decimal
if @ConsumerID is null
set @ConsumerID = 1
insert fnConsumerID values( @ConsumerID)
update tblConsumerNo set fnConsumerID = @ConsumerID + 1
set @outvar = @ConsumerID