Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Fastest way to split delimited string in SQL Server

By Kshitij Satpute,

With this script we'll convert the string into xml and parse it using x-query. This method allows us to overcome R-BAR and produces zero reads.

It is the fastest way to split a delimited string where delimiter length within the string may or may not vary.

Total article views: 4600 | Views in the last 30 days: 6
 
Related Articles
FORUM

string Comparison.

'string' = 'string___' ???

FORUM

Manipulate String

String Output

FORUM

csv string

csv string

FORUM

string formatting

String Formatting

FORUM

parse/split string

string manipulation

Tags
r-bar    
split delimited string.    
split string    
sql server    
t-sql    
xquery    
 
Contribute