In The Netherlands we use bankaccountnumbers that need to comply to a test call 'elfproef'. This test evaluates the sum of each number multiplied by the position the number appears in the accountnumber. If the modulos of the sum divided by 11 is zero then the accountnumber is valid. The length of a bankaccountnumber in the Netherlands should be 9 numbers.
For this 'elfproef' several examples can be found for VB but I saw it never implemented in T-SQL code.
Below a T-SQL User-Defined function that does the job.
2007-10-02 (first published: 2002-06-20)
15,451 reads