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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Special Character Issue

Author  Topic 

mrpreethi
Starting Member

10 Posts

Posted - 2010-06-08 : 02:46:31
Hi ,

I have a table names 'XYZ'.It has one column id.This column should contain combination of only numbers and alphabets .While inserting some special characters are inserted .How to get a query which selects only those rows with combination of numbers and alphabets and not with special characters ?

Thanks ,
Preethi MR

sakets_2000
Master Smack Fu Yak Hacker

1472 Posts

Posted - 2010-06-08 : 02:50:27
You can use replace function if you know the list of special character or else write a function.
Go to Top of Page

sakets_2000
Master Smack Fu Yak Hacker

1472 Posts

Posted - 2010-06-08 : 02:52:44
You could pick the code from here http://www.source-code.biz/snippets/mssql/1.htm
Test it once, I haven't used this function before.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-06-08 : 03:05:54
Also refer this
http://beyondrelational.com/blogs/madhivanan/archive/2009/02/16/find-alphanumerals-only.aspx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -