Re: IS*ALPHA*()
(laurenquantrell@xxxxxxxxx) writes:
I have a string '5B3' and I want to determine if it is both not
numeric and not alpha.
For example:
ISNUMERIC('5B3') = 0
This doesn't help me identify that is isn't all alpha either.
What I'm looking for is the equivalant of
IS*ALPHA*('5B3') = 0
or
IS*MIXED*('5B3') = 1
This string could vary in length and the position of the Alphas and
Numerics also varies.
While I'm at it, is there a way to identify an specific alphanumeric
patten in a string?
For example:
strPattern = #A#A## (where # = number, A = alpha)
strData = '9B3Z21' = true
strData = 'B93Z21' = false
Certainly looks like candidate for using the CLR.
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Links for SQL Server Books Online:
SQL 2008:
http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005:
http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000:
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
Relevant Pages
- Re: script order of objects
... (sql 2005 manager). ... udf's and would like to be able to get them out of the db in alpha ... I think your best bet is to select to script them to separate files. ... Links for SQL Server Books Online: ... (microsoft.public.sqlserver.programming) - Re: A new twist on the last problem (D3/NT)
... This synonym gave me all the alphas in the record ID so for the above ... data I got 1 to 3 alpha characters, which was great as it allowed me to ... wanted just the first alpha part before the numeric, ie R, RC, SZY. ... and the following numerics can vary, but the end alpha (after the ... (comp.databases.pick) - A new twist on the last problem (D3/NT)
... This synonym gave me all the alphas in the record ID so for the above ... data I got 1 to 3 alpha characters, which was great as it allowed me to ... wanted just the first alpha part before the numeric, ie R, RC, SZY. ... and the following numerics can vary, but the end alpha (after the ... (comp.databases.pick) - Re: I need help with my SQL Statement
... Although it works in Access it does not work in MS SQL. ... converting string to double numeric on the fly within MS SQL. ... The function is not recognized by SQL Server Compact Edition. ... types to numerics. ... (microsoft.public.sqlserver.ce) - Re: copyFromRecordset - vs - getRows
... SQL Server, Access, other? ... efficient to have the db convert the string to numeric - that way, ... recordset field will be numeric, and Excel should treat the corresponding ... > retrieved data from strings to numerics (really - just trimming the ... (microsoft.public.excel.programming) |
|