The ParseName function is very useful for getting parts out of a string of characters between delimiters. But a limitiation is that you only can get four parts out, and the function only accepts dots as delimiters.
The function I have written below overcomes that limitations, and add a new feature to enable "from left" and "from right" character extraction.
Example code
declare @var varchar(200)
select @var = 'a.ab.abc.abcd.abcde'
select @var,
dbo.fnParseString(4, '.', @var),
dbo.fnParseString(-4, '.', @var)
Creating a PDF from a Stored Procedure in SQL Server
A short but interesting article, the author has figured out a way to create a PDF from a stored procedure without using a third party library.
2019-09-20 (first published: 2003-08-26)
72,963 reads