How to validate Zip Code which should not exceed more that 5 digits with check constraint?

 Posted by vishalneeraj-24503 on 9/1/2014 | Category: Sql Server Interview questions | Views: 2418 | Points: 40

We can write below script to validate Zip code as:
Alter Table Employee_Master

Add Constraint CK_Zip_Code
Check ([ZIP_Code] Like '[0-9][0-9][0-9][0-9][0-9]')

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response