Prepare for your Next Interview
This is a discussion on SQL Server Replace Function within the SQL Server forums, part of the Databases category; Hello, i am looking for sql server equivalent function for this ... Could some one help me ... PHP Code: function removealphas ( byval alphanum as variant ) ...
|
|||
|
SQL Server Replace Function
Hello, i am looking for sql server equivalent function for this ...
Could some one help me ... PHP Code:
|
| Sponsored Links |
|
|||
|
Re: SQL Server Replace Function
CREATE FUNCTION dbo.REMOVEALPHA
(@str VARCHAR(8000)) RETURNS VARCHAR(8000) BEGIN declare @validchars varchar(8000) set @validchars = '0-9' WHILE PATINDEX('%[^' + @validchars + ']%',@str) > 0 SET @str=REPLACE(@str, SUBSTRING(@str ,PATINDEX('%[^' + @validchars +']%',@str), 1) ,'') RETURN @str END GO Execuete: SELECT dbo.REMOVEALPHA('REPLACEAPHA1111122') |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| replace the symbols... | psuresh1982 | Brainteasers | 1 | 01-30-2007 01:57 AM |
| DNS server in Windows server 2000 | FantaGuy | Web Servers | 2 | 12-13-2006 03:21 PM |
| replace the letters.......... | psuresh1982 | Brainteasers | 2 | 11-29-2006 01:50 AM |
| Microsoft CRM : Install Microsoft Dynamics CRM 3.0 Server using a Microsoft Exchange Server cluster environment | Jim.Anderson | Microsoft CRM | 0 | 09-27-2006 07:39 AM |
| Microsoft CRM : Installing Microsoft CRM 3.0 Server using a Microsoft SQL Server cluster environment | Jim.Anderson | Microsoft CRM | 0 | 09-27-2006 07:39 AM |