Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
liagrisj
Starting Member
9 Posts |
Posted - 2010-03-12 : 10:43:22
|
| I'm trying to figure out how to select and delete, out of a column, an exact number of characters.Example: I have a column that is filled with people's first and last names. I want to delete cells that have a certain number of characters. So if my list was as follows:eric brown stephanie smith corey monroejonathan stephensonI need a statement that if I said to delete cells that had 12 or less characters, that eric brown and corey monroe would be deleted. The other two names would remain untouched. Thanks a lot. I thought a simple google search would help...it did not. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-03-12 : 10:57:29
|
| [code]DELETE tFROM table tWHERE LEN(Name)<=12[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
liagrisj
Starting Member
9 Posts |
Posted - 2010-03-12 : 11:55:30
|
| That worked well. Thank you so much! |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-03-12 : 11:59:36
|
| welcome------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|