script to check length of values - set to NULL if not correct

Hi

I need to cycle through each row in a table "aspnet_Membership"
And check if the "COMMENT" value is 4 digits long (or NULL)
If they are less than or greater than 4 digits long i need to set them to NULL

The highlghted example is over 4 digits so i need to set to NULL
null digits
can anyone help with the SQL please
websssAsked:
Who is Participating?
 
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
update aspnet_Membership
  set comment = null
where len(COMMENT) > 4
0
 
jayakrishnabhCommented:
update aspnet_Membership
set Comment=null
where len(ISNULL(Comment,''))<>4
0
 
ste5anSenior DeveloperCommented:
Sounds like your misusing the comment column..
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.