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

Using a function to parse/return the Nth field of a delimited column Expand / Collapse
Author
Message
Posted Monday, October 19, 2009 11:28 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Tuesday, October 20, 2009 4:30 PM
Points: 32, Visits: 13
Comments posted to this topic are about the item Using a function to parse/return the Nth field of a delimited column
Post #805442
Posted Friday, November 6, 2009 11:14 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, December 6, 2012 4:37 PM
Points: 56, Visits: 60
There is a slight problem with your first IF statement if you truly intend for the delimiter to be "... any weird combination of characters that you think is unique to the source file..."

The statement would need to be changed to:

IF right(@EntString,LEN(@Delimiter))<>@Delimiter

otherwise your delimiter is limited to 1 character
Post #815099
Posted Monday, July 2, 2012 9:19 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Monday, October 28, 2013 5:13 AM
Points: 61, Visits: 721
Is there any way of adapting this so that the query took for example the 5th value after a certain value came up in a delimited string? With the certain value arising fairly often.
Post #1323844
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse