declare @my_new_recid bigint exec sp_GetNextRecId @tableid = 104532, @recid = @my_new_recid output select @my_new_recid