0
votes

I have a SQL CLR function which at the moment returns a string seperated by a comma.

How would I code the statement to return two new columns into my resultset.

For example

Select A, B, MyCLRFunction(X,Y) C From MyTable

Returns:-

One    Two    Three,Four
Five   Six    Seven,Eight

I would want it to return :-

One    Two    Three    Four
Five   Six    Seven    Eight
1

1 Answers

3
votes

You will need to convert your CLR function from scalar- to table-valued to allow it to return more than one column.

see the MSDN entry on CLR TVF

It's not possible to provide a more detailed answer without more information in the question.