• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 385
  • Last Modified:

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
0
websss
Asked:
websss
1 Solution
 
Guy Hengel [angelIII / a3]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

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now