Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Validating Canadian Postal Codes

By Ryan,

For fellow Canadians and neighbours to the south, you may find useful a function to validate the formatting of a Canadian postal code.  More than once I've had to work with web programmers on checking that a postal code meets the A1A1A1 style, so carry around a function that simply returns a true/false bit if a submitted varchar value does not meet our Canadian postal code standard.  I hope you find it useful!  Thanks to a colleague Patrick M. for quality checking this script.

Total article views: 222 | Views in the last 30 days: 1
Related Articles

Validating Canadian Postal Codes

Comments posted to this topic are about the item [B]Validating Canadian Postal Codes[/B]


Canadian Postal Code validator

Comments posted to this topic are about the item [B]Canadian Postal Code validator[/B]


Canadian Postal Code Format

Hello, all: I'm fairly new to T-SQL, so I'm sure there's a relatively simple way of doing this, b...


Canadian Postal Code and US Zip

I have an import process where we receive US Zip and Canadian Postal Codes in the same field. We use...


The SQL Server Postal Service

One way to understand Service Broker is to think of it as a postal service. New author Sachin Dedhia...