An issue of numeration

3 posts, 1 answers
  1. Vitaliy
    Vitaliy avatar
    36 posts
    Member since:
    Dec 2008

    Posted 29 Apr 2010 Link to this post

    Probably you answered on a similar question already - I cannot find.

    MS SQL 2005, FW 3.5, window forms

    We have two persistent objects:
    1. Vouchers - a grouping of financial transactions
    2. Cheques - bank cheques

    For both of them we use an 'user friendly'  numeration.
    I.e. started with 1, within a group (the voucher numbers are unique within a financial group, the cheque numbers are unique within the bank account), and no gaps.

    We implemented numeration for both of objects.
    For vouchers in the insert trigger.
    For cheques in the C# code.

    Everything worked fine, but the accountants want to see the voucher order should really match the order of the Cheque Numbers.
    I.e. this is no good:
    Voucher Number Cheque Number
    409 100624
    411 100625
    412 100626
    410 100627

    Cheque number chains are user editable.
    The system recreates every cheque voucher when the cheque changed.
    Every cheque can have 1:many vouchers associated with.

    I do understand that this in not a clear Open Access issue. And the direct solution would be to implement both numerations on the client side code.
    But It would be grateful if you could help me with any suggestion about how to implement this easier.
    E.g. if I could change the insert statement order for vouchers?
    Any other idea?

    Many thanks
  2. Answer
    Serge
    Admin
    Serge avatar
    375 posts

    Posted 30 Apr 2010 Link to this post

    Hello Vitaliy,

     Unfortunately there is no good and easy solution to your problem. The best case would be to implement both number generation on the client side. The only thing I can remember of other than that, is to commit after each insert and make sure that you are inserting them in the correct order. Note that this approach might cause your application to lose performance.

    Also are these numbers the underlying primary keys or are they just for the purpose of displaying some friendly strings? If they are the later it should not be too hard to implement some procedure that updates them correctly.

    I do hope this helps.

    Sincerely yours,
    Serge
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. DevCraft banner
  4. Vitaliy
    Vitaliy avatar
    36 posts
    Member since:
    Dec 2008

    Posted 04 May 2010 Link to this post

    Also are these numbers the underlying primary keys or are they just for the purpose of displaying some friendly strings?
    They are data domain primary keys, but not the database primary keys.

    Thank you.
    'No' answer is an answer too :-)
Back to Top