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 2000 Forums
 Transact-SQL (2000)
 stripping characters when SELECTing

Author  Topic 

littlewing
Starting Member

33 Posts

Posted - 2005-12-14 : 09:03:09
Hello, is there a way to strip characters from a column when SELECTing so that my SELECT statement will find the record (cannot use a LIKE clause)?

Example:
Column: PartNumber (nvarchar, 100)
Sample data in PartNumber
12-34(5)
334
45-3Aw
23 7(ws-33)

My select has to be an exact match so if submitted @Partnumber = 12345
then the query should find the first record. (I strip non-alphanumerics on the input string before it reaches the query so if user enters 12-34(5), @Partnumber will be 12345.)

Something like:

SELECT * from tblParts WHERE dbo.StripNonAlphanumericCharacters(PartNumber) = @Partnumber

IS a function like that possible?

Thank you.

LW

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-12-14 : 09:04:32
Refer this
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=56713

Madhivanan

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

- Advertisement -