|
Execute the following
script in Query Editor to demonstrate the application of the isnumeric() function to check for non-numeric zip (postal) codes like the ones used in Canada and United Kingdom:
USE AdventureWorks2008;
GO
SELECT DISTINCT
City,
StateProvinceCode,
Country = cr.Name,
PostalCode
FROM Person.Address a
INNER JOIN Person.StateProvince sp
ON a.StateProvinceID = sp.StateProvinceID
JOIN Person.CountryRegion cr
on cr.CountryRegionCode = sp.CountryRegionCode
WHERE ISNUMERIC(PostalCode)<> 1
ORDER BY Country, StateProvinceCode, City;
GO
|