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)
Thank this author by sharing:
By Jesse Roberge,
Delimited String Parsing Functions - Big Setby Jesse Roberge - YeshuaAgapao@gmail.comUpdate: Added robustness for NULL inputs and made it return no rows on blank inputs.
Feed it large strings of delimited horizontal data and it returns it back as a vertical table.The Big function set supports more than 8000 character delimited strings, but the individual elements must be 8000 characters or less.If you like performance you don't need to process delimited strings over 8000 characters, then use the basic delimiter function set instead of the Big delimiter function set.Requires a table of numbers. These functions expect it to be called 'Counter' in the same database that you save these functions to.Search for 'Counter table (table of numbers) setter-upper for SQL Server 2005' or Counter table (table of numbers) setter-upper for SQL Server 2000' if you need a script to set this up for you.Works in both SQL Server 2000 and 2005.
Variants: Array Has array position index and value data is not casted. Table No array position index and value data is not casted. IntArray Has array position index and value data is casted to int. IntTable No array position index and value data is casted to int.In the Big2D delimiter function set, the table variants have some performance gain over the array variants, but are not very useful except in joins.
Usage: SELECT * FROM dbo.fn_DelimitToArray_Big ('red,green,yellow,blue,orange,purple',',') AS Delimit SELECT * FROM dbo.fn_DelimitToIntArray_Big('1111,22,333,444,5555,66',',') AS Delimit SELECT * FROM dbo.fn_DelimitToIntTable_Big ('1111,22,333,444,5555,66',',') AS Delimit SELECT * FROM dbo.fn_DelimitToTable_Big ('red,green,yellow,blue,orange,purple',',') AS Delimit
Copyright: Licensed under the L-GPL - a weak copyleft license - you are permitted to use this as a component of a proprietary database and call this from proprietary software. Copyleft lets you do anything you want except plagarize, conceal the source, or prohibit copying & re-distribution of this script/proc.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
see <http://www.fsf.org/licensing/licenses/lgpl.html> for the license text.
Feed it delimited horizontal data and it returns it back as a vertical table.
How to pass a mutli-valued integer parameter as an array to a VB function
Feed it large strings of double-delimited horizontal data and it returns it back as a non-pivoted ve...
Feed it double-delimited horizontal data and it returns it back as a non-pivoted vertical table with...
Array in SQL server