SQL CLR 返回两个新列 [英] SQL CLR return two new columns

查看:21
本文介绍了SQL CLR 返回两个新列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 SQL CLR 函数,它现在返回一个用逗号分隔的字符串.

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.

例如

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

返回:-

One    Two    Three,Four
Five   Six    Seven,Eight

我希望它返回:-

One    Two    Three    Four
Five   Six    Seven    Eight

推荐答案

您需要将 CLR 函数从标量转换为表值,以允许它返回多列.

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

请参阅 CLR TVF 上的 MSDN 条目

如果问题中没有更多信息,就不可能提供更详细的答案.

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

这篇关于SQL CLR 返回两个新列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆