Actually I have table called fruits which has column name fruits_type having records like record1:apple banana & mango record2:apple chickoo & peach It has fruit id as identity column. I should split data for first record like row1-apple row2-banana & mango and in similar ways for second record it sud like row1-apple row2-chickoo & peach Here delimiter is char(30)+char(10) I tried to write split function as follow:
declare @string declare @delimiter select @string=fruits_type from fruits where fruit_id=1 set @delimiter=char(30)+char(10)
There are lot of records like this in that table. so final result sud be like
sr.no fruit_tye 1 apple 2 banana & mango 3 apple 4 chickoo & peach
This record has to be fetched in temp table but duplicate records have to be eliminated. so final temp table sud be like
1 apple 2 banana & mango 3 chicko & peach
I think we can write function or within stored procedure,we can write cursor for row by row processing.But I don't know to write complex query.Please it's urgent.Can anyone help me with the code.It's too urgent.