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: 3053 | Points: 40
Answer:

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