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 |
|
cipriani1984
Constraint Violating Yak Guru
304 Posts |
Posted - 2011-02-07 : 07:17:43
|
| Hi,Im trying to write a function that checks the letters, characters in the field are readable?As the etl we have loads all the data from the files we gain, but trying to work out which have crap data.So if companyname comes up as -(#$/ etc i want to flag up, or any unicode foriegn symbols like windings etc.Thanks in advance. |
|
|
MIK_2008
Master Smack Fu Yak Hacker
1054 Posts |
Posted - 2011-02-07 : 07:50:31
|
| PATINDEX |
 |
|
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2011-02-07 : 07:52:50
|
| SQL Server hasn't had any real support for regex, so people have had to resort to clr integration to use them -> http://msdn.microsoft.com/en-us/magazine/cc163473.aspx. However, I just learned when doing a bit of research for my answer to this topic that the Master Data Services in 2008 R2 has some regex-support. I haven't really looked that much in to it yet but it looks promising:http://msdn.microsoft.com/en-us/library/ee633712(SQL.105).aspx- LumbagoMy blog-> www.thefirstsql.com |
 |
|
|
cipriani1984
Constraint Violating Yak Guru
304 Posts |
Posted - 2011-02-07 : 08:04:36
|
So theres nothing able to use to check wether the field is readable or not?Just trying to avoid stuff like ???????-????????AND???Thats actually coming out of the database from the files coming inetc.quote: Originally posted by Lumbago SQL Server hasn't had any real support for regex, so people have had to resort to clr integration to use them -> http://msdn.microsoft.com/en-us/magazine/cc163473.aspx. However, I just learned when doing a bit of research for my answer to this topic that the Master Data Services in 2008 R2 has some regex-support. I haven't really looked that much in to it yet but it looks promising:http://msdn.microsoft.com/en-us/library/ee633712(SQL.105).aspx- LumbagoMy blog-> www.thefirstsql.com
|
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2011-02-07 : 09:54:37
|
Try this:where Col like '%[^A-Za-z0-9][^A-Za-z0-9]%'to find values with more than one not wanted character in sequence... No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
Lumbago
Norsk Yak Master
3271 Posts |
|
|
|
|
|