e
q
u
e
s
t
a
d
e
m
o
CLR Reference: Zip Code
{TOC}
"Zip Code"
CLR function
SQLCLR:
SELECT [dbo].[ZipCodeRandom] (<@ZipCode, nvarchar(4000)>)
Expected input
Data: Valid USA or Canadian Zip Code
Expected output
Generic USA or Canadian Zip Code (depends on input) (nvarchar(MAX))
Error handling
Returns an empty string when passing empty or NULL value. Fails on invalid zip code format
Example
SQLCLR:
SELECT [dbo].[ZipCodeRandom] ('K1A 0B1')