dynamic columns in CLR table-valued-function

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?RnJhbmsgVXJheQ==?=

    dynamic columns in CLR table-valued-function

    Hi all

    I think this question was discused quite often before.
    But maybe some "good-brain" has a great idea ... :-)))

    I have a DataSet with "unknown" columns.

    The CLR Function should work like the normal TVF:
    ALTER FUNCTION [dbo].[fncTest] ()
    RETURNS TABLE
    AS
    RETURN
    (SELECT * FROM sys.objects)

    Any ideas or comments on that ??

    Thanks and best regards
    Frank Uray
  • Duggi

    #2
    Re: dynamic columns in CLR table-valued-function

    On Oct 8, 8:26 am, Frank Uray <FrankU...@disc ussions.microso ft.com>
    wrote:
    Hi all
    >
    I think this question was discused quite often before.
    But maybe some "good-brain" has a great idea ... :-)))
    >
    I have a DataSet with "unknown" columns.
    >
    The CLR Function should work like the normal TVF:
    ALTER FUNCTION [dbo].[fncTest] ()
    RETURNS TABLE
    AS
    RETURN
    (SELECT * FROM sys.objects)
    >
    Any ideas or comments on that ??
    >
    Thanks and best regards
    Frank Uray
    I think DataSet contains tables and table contains rows.

    Please correct me if I am wrong.

    -Cnu

    Comment

    • =?Utf-8?B?Q2lhcmFuIE8nJ0Rvbm5lbGw=?=

      #3
      RE: dynamic columns in CLR table-valued-function

      There isnt a lot of information in your question to base an answer on. What
      exactly is it you are trying to acheive and why do you want to use a SQLCLR
      function to achieve it.?

      --
      Ciaran O''Donnell
      try{ Life(); } catch (TooDifficultException) { throw Toys(); }



      "Frank Uray" wrote:
      Hi all
      >
      I think this question was discused quite often before.
      But maybe some "good-brain" has a great idea ... :-)))
      >
      I have a DataSet with "unknown" columns.
      >
      The CLR Function should work like the normal TVF:
      ALTER FUNCTION [dbo].[fncTest] ()
      RETURNS TABLE
      AS
      RETURN
      (SELECT * FROM sys.objects)
      >
      Any ideas or comments on that ??
      >
      Thanks and best regards
      Frank Uray

      Comment

      • =?Utf-8?B?RnJhbmsgVXJheQ==?=

        #4
        RE: dynamic columns in CLR table-valued-function

        Hello

        Maybe my question was not clear.

        The goal is to create a SQL Function like:
        SELECT *
        FROM SqlFunction ('C:\temp\test. csv')

        This function should give the .csv table based back.

        The problem is:
        Of corse, it is easy to create in the CLR a DataSet
        with all the rows and columns.
        But there is now way to have a CLR Function
        with dynamic columns because I dont know
        what columns are in the .csv.

        I did it alrady with a SQL Procedure,
        but in the case I always have to select
        like: SELECT * FROM openquery(serve rname, 'EXEC TheStoredProced ure').

        I hope this is more explaining.

        Best regards
        Frank

        "Frank Uray" wrote:
        >
        Hi all

        I think this question was discused quite often before.
        But maybe some "good-brain" has a great idea ... :-)))

        I have a DataSet with "unknown" columns.

        The CLR Function should work like the normal TVF:
        ALTER FUNCTION [dbo].[fncTest] ()
        RETURNS TABLE
        AS
        RETURN
        (SELECT * FROM sys.objects)

        Any ideas or comments on that ??

        Thanks and best regards
        Frank Uray

        Comment

        Working...