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 |
Blessed1978
Yak Posting Veteran
97 Posts |
Posted - 2014-10-27 : 17:26:48
|
I need a Sql like me syntax that matches pattern ########-#####-####-####-############ represents any number |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2014-10-27 : 17:42:08
|
Not sure if there's a shorter way, but here goes:select * from table1 where column1 like '[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
|
|
Blessed1978
Yak Posting Veteran
97 Posts |
Posted - 2014-10-27 : 17:49:38
|
K what about the - between the numbers |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2014-10-27 : 17:56:22
|
The dashes are already in there. Might be hard to spot due to the dash between 0 and 9, but the extra dashes between the numbers are in there too if you look closely.Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
|
|
|
|
|