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 |
NiceSituation
Starting Member
22 Posts |
Posted - 2007-10-31 : 14:01:47
|
I have a table in my database in which a certain field (let's call it "card number") is defined as varchar. Sometimes this field will be a numerical value (contains only numbers), and sometimes it will include non-numerical characters (that's why we did not define it as integer, though the value may include numerical characters together with non-numerical characters). What I would like to do is create a view in which I get all rows whose card number is a numerical value, and another view in which I get all rows whose card number is non-numerical. However, I cannot think of a way to do this. Any suggestions?May today be good, and tomorrow better |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-10-31 : 14:09:41
|
http://weblogs.sqlteam.com/mladenp/archive/2007/10/18/SQL-Server-Filtering-Numeric-data-from-a-character-based-column.aspx_______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenpSSMS Add-in that does a few things: www.ssmstoolspack.com |
 |
|
NiceSituation
Starting Member
22 Posts |
Posted - 2007-10-31 : 15:11:58
|
Thanks, that's just what I needed.May today be good, and tomorrow better |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-11-01 : 02:44:40
|
Other methodSelect.......Where ISNUMERIC(col+'d0')=1MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|