e
q
u
e
s
t
a
d
e
m
o < back
CLR Reference: Credit Card
{TOC}
"Credit Card "
CLR function
<.CLRSQLCLR: function:
SELECT xxxxx(xxx,xxx,xxx)>[dbo].[CreditCardRandom] (<@creditCard, nvarchar(4000)>)
Expected input
<.expectedData: input:Credit datacard type,number rule,including sample>separators (Letters are not allowed). Digits count must be between 13 and 20.
Expected output
<.expectedCredit output:card datanumber type,of rule,the sample>same length and separators positions with LUHN validation string (nvarchar(MAX))
Error handling
<.errorFails handling>on empty or Null values.
Fails on values that contains less than 13 digits or more than 20 digits.
Example
<.example>SQLCLR:
SELECT [dbo].[CreditCardRandom] ('1234-5678-9876-5432')