Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

SQL Function to remove excess characters Expand / Collapse
Author
Message
Posted Wednesday, March 12, 2014 2:59 PM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, August 25, 2014 8:35 PM
Points: 187, Visits: 434
Thanks all. Your SQL skills humble me all the time. Amazing detail as always. I am so thankful to be part of such a community.
Post #1550433
Posted Friday, March 28, 2014 1:24 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Monday, November 17, 2014 1:28 AM
Points: 64, Visits: 521
SELECT 'SO-123456' AS OrderNo into #test
UNION ALL
SELECT 'SO-123456-01'
UNION ALL
SELECT 'SO-123456-2'
UNION ALL
SELECT 'SO-123457'
UNION ALL
SELECT 'SO-123457-1'
UNION ALL
SELECT 'SO-123457-02'
UNION ALL
SELECT 'SO-123458'
union all
select 'SO-123459=02'
select * from #test where OrderNo like '%[^A-Z]-[0-9]%'
DROP table #test
Post #1555789
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse