Daily Archive » 07 January 2015

SQL function to split string

Here’s a handy user definedĀ function to split string into comma separated line:

/****** Object: UserDefinedFunction [dbo].[ufnSplitString] Script Date: 19/11/2015 11:18:20 AM ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE FUNCTION [dbo].[ufnSplitString](

@String varchar(max),

@Delimiter char(1),

@Column int = 1

)

Read More