0

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
general exception
  • 3,752
  • 6
  • 46
  • 78

1 Answers1

3

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.

Ed Harper
  • 20,269
  • 4
  • 49
  • 79
  • 2
    The OP would also need to switch from calling the function in the `SELECT` clause to using `CROSS APPLY` or similar (just in case this part wasn't obvious). – Damien_The_Unbeliever May 04 '12 at 10:38