Вот как бы я это сделал:
-- Sample Data
DECLARE @CUSTOMER_TBL TABLE (VAT_CODE VARCHAR(36));
INSERT @CUSTOMER_TBL VALUES ('GB123111GB'),('GB9999111'),('GBB9999111'),('GGB7777222'),
('553399444'),('GB22223366'),('GB22223366X')
-- solution
SELECT t.VAT_CODE, VAT_MATCH = IIF(f.H = 'GB' AND PATINDEX('%[^0-9]%',f.B) = 0,'Yes','No')
FROM @CUSTOMER_TBL AS t
CROSS APPLY (VALUES (SUBSTRING(t.VAT_CODE,1,2),SUBSTRING(t.VAT_CODE,3,8000))) AS f(H,B);
/* For pre-2012 systems:
VAT_MATCH = CASE WHEN f.H = 'GB' AND PATINDEX('%[^0-9]%',f.B) = 0 THEN 'Yes' ELSE 'No' END */;
Результаты
VAT_CODE VAT_MATCH
------------------------------------ ---------
GB123111GB No
GB9999111 Yes
GBB9999111 No
GGB7777222 No
553399444 No
GB22223366 Yes
GB22223366X No