lundi 27 juillet 2015

sql string parse

So I have a function that splits a string based on a character provided. For example person = "sam, 25;tony, 19" If I use the function(person, ';') it'll return a table resulting_table = "sam, 25" "tony, 19"

Now I have another table and I wants to insert the index of ',' for each row in it. I am using

insert into dbo.test_table_1(index) select charindex(',', select * from dbo.fn_parse_function(@json_string, ';'));

It is giving me error. Can anyone point me in the right direction? Thanks in advance

Aucun commentaire:

Enregistrer un commentaire