in the below script I have changed function getnextclaimnumber() to be a store procedure in sql server 2012, that uses a sequence generator.My question now is though how can I alter the script to execute that procedure, but also assign the return OUTPUT value to 'claim_id'RESERVE_CLAIM_NUMBER_SQL_TEMPLATE = "SELECT getnextclaimnumber() as claim_id";
* would Exec getnextclaimnumber @NextCMSClaimNumber as Claim_ID work?the function was some java that was creating a sequence gen. But basically I'm removing all there java code and php code from doing the bulk of the work on a Postgres DB. By moving everything over to SQL Server environment, and well this particular function they had in java is simply done SQL 2012 with Sequences. So I just built out a Sequence gen and called it in this store procedure, but I place the return value in a OUTPUT variable.ALTER PROCEDURE [claims].[getnextclaimnumber] @NextCMSClaimNumber VarChar(20) OUTPUTASBEGIN SET NOCOUNT ON -- Calls next avaliable claim number in sequence -- SELECT @NextCMSClaimNumber = NEXT VALUE FOR claims.ClaimNumber -- Appends '0' to claim number -- Select '0'+ @NextCMSClaimNumber End