带CLR的返回表 [英] Returning table with CLR

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

问题描述

我想编写一个CLR过程,该过程接受文本并返回包含该文本中所有单词的表。但我不知道如何返回表格。你能告诉我吗?

I want to write an CLR procedure which takes a text and returns a table with all the words in this text. But I can't figure out how to return a table. Could you please tell me it?

    [Microsoft.SqlServer.Server.SqlFunction]
    public static WhatTypeShouldIWriteHere Function1(SqlString str)
    {
        string[] words = Regex.Split(str, @"\W+").Distinct().ToArray();
        //how to return a table with one column of words?
    }

感谢您的帮助。

已更新:我需要在sql-2005中使用它

UPDATED: I need to do it for sql-2005

推荐答案

<您可以返回任何实现IEnumerable的列表。检查

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

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