RosettaCodeData/Task/Validate-International-Securities-Identification-Number/Transact-SQL/validate-international-securities-identification-number-2.sql
2023-07-01 13:44:08 -04:00

13 lines
440 B
SQL

-- Testing. The following tests all pass.
;WITH ISIN_Tests AS
( SELECT 'US0378331005' AS ISIN, 1 Expected
UNION SELECT 'US0373831005',0
UNION SELECT 'U50378331005',0
UNION SELECT 'US03378331005',0
UNION SELECT 'AU0000XVGZA3',1
UNION SELECT 'AU0000VXGZA3',1
UNION SELECT 'FR0000988040',1
UNION SELECT '0___garbage',0
UNION SELECT '',0
)
SELECT ISIN, Expected, dbo._ISINCheck(ISIN) AS TestResult FROM ISIN_Tests ORDER BY ISIN