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 |
|
ruchirj07
Starting Member
37 Posts |
Posted - 2008-01-28 : 08:37:39
|
| Hi,I have some values in table say ; 152, 152-abc, 152-xyz, abc-152, 153,210 etc etcis there any function in sql server which can fetch me only real numbers out of this lot? (152,153,210)or else i have to write a stored procedure for the same?Ruchir |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2008-01-28 : 08:41:10
|
| Where isNumeric(<column>) will get you 99.9 percent of the way. isNumeric may return some false positives but if that is the case post some examples and we can tell you how to deal with it.Be One with the OptimizerTG |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-01-28 : 08:42:33
|
SELECT * FROM Table1 WHERE NOT Col1 LIKE '%[^0-9]%' E 12°55'05.25"N 56°04'39.16" |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-01-28 : 09:13:08
|
| and if you want to take care of decimal palces as well, thenwhere isnumeric(col+'d0')=1MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|