Showing posts with label sql server. Show all posts
Showing posts with label sql server. Show all posts

Thursday, 2 September 2010

Splitting string with deliminator In SQL Server



During my work I came to a problem where I had to extract some numbers from a comma

separated list of numbers in TSQL 2008 (Sql Server).
I had to extract last seven numbers from a comma separated list of 14 numbers.
Just for the start I created a table function called ufn_Split.
This function takes two arguments:
1. Data
2. Deliminator
And it returns the split data in a tabular format.
Below is the function :


___________________________________________________________________
Mitul Patel
___________________________________________________________________

I recommend the following books to improve your T-SQL Skills.